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

    Class DPoPError

    Represents an error that occurred during DPoP (Demonstrating Proof-of-Possession) operations.

    This class wraps authentication errors related to DPoP functionality, such as:

    • Key generation and storage failures
    • DPoP proof generation failures
    • Token binding validation errors
    • Nonce handling errors

    The type property provides a normalized, platform-agnostic error code that applications can use for consistent error handling across iOS, Android, and Web.

    try {
    const headers = await auth0.getDPoPHeaders({
    url: 'https://api.example.com/data',
    method: 'GET',
    accessToken: credentials.accessToken,
    tokenType: credentials.tokenType
    });
    } catch (error) {
    if (error instanceof DPoPError) {
    switch (error.type) {
    case 'DPOP_GENERATION_FAILED':
    console.log('Failed to generate DPoP proof');
    break;
    case 'DPOP_KEY_STORAGE_FAILED':
    console.log('Failed to store DPoP key securely');
    break;
    }
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Properties

    Constructors

    Methods

    • A static factory method to create an AuthError from a fetch Response object. This is a utility that platform adapters can use for consistency.

      Parameters

      • response: Response

        The fetch Response object.

      • body: any

        The parsed body of the response (can be JSON or text).

      Returns AuthError

      A new AuthError instance.

    Properties

    status: number

    The HTTP status code of the error response, if available.

    code: string

    The error code returned by Auth0 (e.g., 'invalid_grant'), if available.

    json: unknown

    The full JSON response body of the error, if available.

    type: string

    A normalized error type that is consistent across platforms. This can be used for reliable error handling in application code.