@auth0/auth0-angular
    Preparing search index...

    Interface ObservablePasskeyApiClient

    Observable-based Passkey API client exposed by AuthService.passkey.

    Wraps PasskeyApiClient from @auth0/auth0-spa-js. signup, continueSignup and login handle the full WebAuthn flow internally and update Angular auth state on success. getSignupChallenge, getLoginChallenge and getTokenWithPasskey are granular APIs for running the WebAuthn ceremony yourself. All methods return Observable instead of Promise.

    interface ObservablePasskeyApiClient {
        continueSignup(
            verification: { email?: string; phone?: string },
        ): Observable<TokenEndpointResponse>;
        getLoginChallenge(
            options?: PasskeyLoginChallengeOptions,
        ): Observable<PasskeyLoginChallenge>;
        getSignupChallenge(
            options: PasskeySignupChallengeOptions,
        ): Observable<PasskeySignupChallenge>;
        getTokenWithPasskey(
            options: PasskeyGetTokenOptions,
        ): Observable<TokenEndpointResponse>;
        login(options?: PasskeyLoginOptions): Observable<TokenEndpointResponse>;
        signup(options: PasskeySignupOptions): Observable<TokenEndpointResponse>;
    }
    Index
    • Continues a signup that was interrupted by identifier verification. Call this after signup() errors with PasskeyVerificationRequiredError, passing an OTP code for each identifier in verificationRequired. Updates isAuthenticated$ and user$ on success.

      If a code is wrong and the session is still active, this errors with a PasskeyGetTokenError where isRetryable is true. Collect new codes for error.verificationRequired and call continueSignup() again; the same passkey is reused, so the user is not prompted again.

      Parameters

      • verification: { email?: string; phone?: string }

      Returns Observable<TokenEndpointResponse>

      With code no_pending_signup, missing_verification_code or passkey_cancelled

      If an OTP code is wrong and the session is still active (isRetryable: true)

      If the token exchange fails

    • Requests a passkey signup challenge.

      Step 1 of the granular signup flow. Emits the authSession and a decoded publicKey (PublicKeyCredentialCreationOptions). Pass publicKey to navigator.credentials.create(), then hand the credential and authSession to getTokenWithPasskey().

      If the connection requires identifier verification, verificationRequired lists the identifiers to verify. Collect the OTP codes before calling navigator.credentials.create() and pass them as verification to getTokenWithPasskey().

      Does not change the auth state.

      Parameters

      Returns Observable<PasskeySignupChallenge>

      If WebAuthn is not supported in the browser

      If the challenge request fails

    • Exchanges a signed passkey credential for tokens.

      Step 2 of the granular flow. Accepts the raw PublicKeyCredential from either navigator.credentials.create() (signup) or navigator.credentials.get() (login). Updates isAuthenticated$ and user$ on success.

      If an OTP code in verification is wrong and the session is still active, this errors with a PasskeyGetTokenError where isRetryable is true. Call getTokenWithPasskey() again with error.authSession, the same credential, and new codes for error.verificationRequired.

      Parameters

      Returns Observable<TokenEndpointResponse>

      If WebAuthn is not supported in the browser

      If the credential is invalid or a code in verification is empty

      If an OTP code is wrong and the session is still active (isRetryable: true)

      If the token exchange fails