light-mode-image
Learn
Functions

createAuthorizationSession

Parses the credentialOffer.

  1. Parses the credentialOffer.
  2. Fetches the metadata of the OpenID4VCI issuer, specified in the offer.
  3. Validates the offer against the issuer's metadata, and builds the DiscoveredCredentialOffer object.
  4. Generates the authorization request and returns the AuthorizationSession.

The AuthorizationSession object contains the AuthorizationSession#authorizeUrl which can be used to start the credential issuance flow. Use this function in conjunction with retrieveCredentials. This function should only be used for Authorization Code Flow.

Signature

function createAuthorizationSession(
  options: CreateAuthorizationSessionOptions
): Promise<Result<AuthorizationSession, MobileCredentialHolderError<CreateAuthorizationSessionErrorType>>>

Parameters

Returns

Promise<Result<AuthorizationSession, MobileCredentialHolderError<CreateAuthorizationSessionErrorType>>>

An Authorization Session object containing the decoded offer and authorization URL.

Throws

InvalidParams if the provided arguments are missing or invalid.

MobileCredentialHolderErrorType.SdkNotInitialized if the SDK has not been initialized.

How would you rate this page?

On this page