@upbond/sdk - v0.0.3
    Preparing search index...

    Function completeAuthorization

    • Complete a login: validate the callback against the stored PendingAuthorization, exchange the code at the token endpoint, and validate the returned id_token's binding claims (issuer, audience, expiry, nonce, subject).

      Parameters

      • config: AuthConfig

        The same config used for beginAuthorization.

      • pending: Pick<PendingAuthorization, "state" | "nonce" | "codeVerifier">

        The state/nonce/codeVerifier persisted at login start.

      • callbackUrl: string

        The full redirect URL the issuer returned to.

      • fetchFn: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        } = fetch

        Injectable fetch (defaults to the global).

          • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
          • Parameters

            • input: URL | RequestInfo
            • Optionalinit: RequestInit

            Returns Promise<Response>

          • (input: string | URL | Request, init?: RequestInit): Promise<Response>
          • Parameters

            • input: string | URL | Request
            • Optionalinit: RequestInit

            Returns Promise<Response>

          • (input: string | URL | Request, init?: RequestInit): Promise<Response>
          • Parameters

            • input: string | URL | Request
            • Optionalinit: RequestInit

            Returns Promise<Response>

      • nowEpochSeconds: () => number = ...

        Injectable clock in epoch seconds (for tests).

      Returns Promise<TokenSet>

      The validated TokenSet.

      The caller must delete the pending state from storage before calling this so a replayed callback can never reuse the verifier (PKCE single-use, docs/24-sdk-design.md D3). Most integrations should use createUpbond instead.

      AuthError on issuer error, missing/invalid callback, state mismatch, a failed token request, or id_token validation failure.