Interface Auth0ContextInterface<TUser>

interface Auth0ContextInterface {
    authorize: ((parameters?, options?) => Promise<undefined | Credentials>);
    authorizeWithEmail: ((parameters) => Promise<undefined | Credentials>);
    authorizeWithOOB: ((parameters) => Promise<undefined | Credentials>);
    authorizeWithOTP: ((parameters) => Promise<undefined | Credentials>);
    authorizeWithRecoveryCode: ((parameters) => Promise<undefined | Credentials>);
    authorizeWithSMS: ((parameters) => Promise<undefined | Credentials>);
    clearCredentials: (() => Promise<void>);
    clearSession: ((parameters?, options?) => Promise<void>);
    error: null | Error;
    getCredentials: ((scope?, minTtl?, parameters?, forceRefresh?) => Promise<undefined | Credentials>);
    hasValidCredentials: ((minTtl?) => Promise<boolean>);
    isLoading: boolean;
    requireLocalAuthentication: ((title?, description?, cancelTitle?, fallbackTitle?, strategy?) => Promise<void>);
    sendEmailCode: ((parameters) => Promise<void>);
    sendMultifactorChallenge: ((parameters) => Promise<void>);
    sendSMSCode: ((parameters) => Promise<void>);
    user: null | TUser;
}

Type Parameters

Hierarchy

Properties

authorize: ((parameters?, options?) => Promise<undefined | Credentials>)

Type declaration

authorizeWithEmail: ((parameters) => Promise<undefined | Credentials>)

Type declaration

authorizeWithOOB: ((parameters) => Promise<undefined | Credentials>)

Type declaration

authorizeWithOTP: ((parameters) => Promise<undefined | Credentials>)

Type declaration

authorizeWithRecoveryCode: ((parameters) => Promise<undefined | Credentials>)

Type declaration

authorizeWithSMS: ((parameters) => Promise<undefined | Credentials>)

Type declaration

clearCredentials: (() => Promise<void>)

Type declaration

    • (): Promise<void>
    • Clears the user's credentials without clearing their web session and logs them out.

      Returns Promise<void>

clearSession: ((parameters?, options?) => Promise<void>)

Type declaration

    • (parameters?, options?): Promise<void>
    • Clears the user's web session, credentials and logs them out. See WebAuth#clearSession

      Parameters

      Returns Promise<void>

error: null | Error

An object representing the last exception

getCredentials: ((scope?, minTtl?, parameters?, forceRefresh?) => Promise<undefined | Credentials>)

Type declaration

    • (scope?, minTtl?, parameters?, forceRefresh?): Promise<undefined | Credentials>
    • Gets the user's credentials from the native credential store. If credentials have expired, they are automatically refreshed by default. See CredentialsManager#getCredentials

      Parameters

      • Optional scope: string

        The scopes used to get the credentials

      • Optional minTtl: number

        The minimum time in seconds that the access token should last before expiration

      • Optional parameters: Record<string, unknown>

        Any additional parameters to send in the request to refresh expired credentials.

      • Optional forceRefresh: boolean

        If true, credentials are always refreshed regardless of their expiry, provided a valid refresh token is available.

      Returns Promise<undefined | Credentials>

hasValidCredentials: ((minTtl?) => Promise<boolean>)

Type declaration

    • (minTtl?): Promise<boolean>
    • Whether the SDK currently holds valid, unexpired credentials.

      Parameters

      • Optional minTtl: number

        The minimum time in seconds that the access token should last before expiration

      Returns Promise<boolean>

      true if there are valid credentials. Otherwise, false.

isLoading: boolean

A flag that is true until the state knows that a user is either logged in or not

requireLocalAuthentication: ((title?, description?, cancelTitle?, fallbackTitle?, strategy?) => Promise<void>)

Type declaration

    • (title?, description?, cancelTitle?, fallbackTitle?, strategy?): Promise<void>
    • Enables Local Authentication (PIN, Biometric, Swipe etc) to get the credentials. See CredentialsManager#requireLocalAuthentication

      Parameters

      • Optional title: string

        the text to use as title in the authentication screen. Passing null will result in using the OS's default value in Android and "Please authenticate to continue" in iOS.

      • Optional description: string

        Android only: the text to use as description in the authentication screen. On some Android versions it might not be shown. Passing null will result in using the OS's default value.

      • Optional cancelTitle: string

        iOS only: the cancel message to display on the local authentication prompt.

      • Optional fallbackTitle: string

        iOS only: the fallback message to display on the local authentication prompt after a failed match.

      • Optional strategy: LocalAuthenticationStrategy

        iOS only: the evaluation policy to use when accessing the credentials. Defaults to LocalAuthenticationStrategy.deviceOwnerWithBiometrics.

      Returns Promise<void>

sendEmailCode: ((parameters) => Promise<void>)

Type declaration

sendMultifactorChallenge: ((parameters) => Promise<void>)

Type declaration

sendSMSCode: ((parameters) => Promise<void>)

Type declaration

user: null | TUser

The user profile as decoded from the ID token after authentication

Generated using TypeDoc