matrix-js-sdk
    Preparing search index...

    Function completeAuthorizationCodeGrant

    Attempt to exchange authorization code for bearer token.

    Takes the authorization code returned by the OpenID Provider via the authorization URL, and makes a request to the Token Endpoint, to obtain the access token, refresh token, etc.

    authorization code as returned by OP during authorization

    authorization state param as returned by OP during authorization

    the response mode used for authentication

    valid bearer token response

    An Error with message set to an entry in OidcError, when the request fails, or the returned token response is invalid.

    • Experimental

      Parameters

      • code: string
      • state: string
      • responseMode: "query" | "fragment" | undefined = "query"

      Returns Promise<
          {
              homeserverUrl: string;
              identityServerUrl?: string;
              idTokenClaims: IdTokenClaims;
              oidcClientSettings: { clientId: string; issuer: string };
              tokenResponse: BearerTokenResponse;
          },
      >