Type alias AuthProvider

AuthProvider: {
    updateClientPublicKey(signingKey?) => Promise<void>;
    withCreds(httpReq) => Promise<HttpRequest>;
}

A utility type for getting and updating a bearer token to associate with HTTP requests to the backend services, notably rewrap and upsert endpoints.

In the TDF protocol, this bearer token will be a wrapper around a signed ephemeral key, to be included in the claims object.

Type declaration

  • updateClientPublicKey:function
    • This function should be called if the consumer of this auth provider changes the client keypair, or wishes to set the keypair after creating the object.

      Calling this function will (optionally) trigger a forcible token refresh using the cached refresh token, and update the auth server config with the current key.

      Parameters

      • Optional signingKey: CryptoKeyPair

        the client signing key pair. Will be bound to the OIDC token and require a DPoP header, when set.

      Returns Promise<void>

  • withCreds:function
    • Augment the provided http request with custom auth info to be used by backend services.

      Parameters

      • httpReq: HttpRequest

        Required. An http request pre-populated with the data public key.

      Returns Promise<HttpRequest>

Generated using TypeDoc