React Native Auth0 - v5.5.0
    Preparing search index...

    Interface IAuth0Client

    The primary interface for the Auth0 client.

    It aggregates all core functionalities (web auth, credential management, etc.) into a single, cohesive contract. Platform-specific factories will produce an object that conforms to this interface.

    interface IAuth0Client {
        webAuth: IWebAuthProvider;
        credentialsManager: ICredentialsManager;
        auth: IAuthenticationProvider;
        users(token: string, tokenType?: TokenType): IUsersClient;
        getDPoPHeaders(params: DPoPHeadersParams): Promise<Record<string, string>>;
        customTokenExchange(
            parameters: CustomTokenExchangeParameters,
        ): Promise<Credentials>;
    }
    Index

    Methods

    • Creates a client for interacting with the Auth0 Management API's user endpoints.

      Parameters

      • token: string

        An access token with the required permissions for the management operations.

      • OptionaltokenType: TokenType

        Optional token type ('Bearer' or 'DPoP'). Defaults to the client's configured token type.

      Returns IUsersClient

      An IUsersClient instance configured with the provided token.

    • Generates DPoP headers for making authenticated requests to custom APIs. This method creates the necessary HTTP headers (Authorization and DPoP) to securely bind the access token to a specific API request.

      Parameters

      • params: DPoPHeadersParams

        Parameters including the URL, HTTP method, access token, and token type.

      Returns Promise<Record<string, string>>

      A promise that resolves to an object containing the required headers.

      const credentials = await auth0.credentialsManager.getCredentials();
      const headers = await auth0.getDPoPHeaders({
      url: 'https://api.example.com/data',
      method: 'GET',
      accessToken: credentials.accessToken,
      tokenType: credentials.tokenType
      });

      fetch('https://api.example.com/data', { headers });

    Properties

    Provides access to methods for handling web-based authentication flows.

    credentialsManager: ICredentialsManager

    Provides access to methods for securely managing user credentials on the device.

    Provides access to methods for direct authentication grants (e.g., password-realm).