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

    Variable DPoPErrorCodesConst

    DPoPErrorCodes: {
        DPOP_GENERATION_FAILED: "DPOP_GENERATION_FAILED";
        DPOP_PROOF_FAILED: "DPOP_PROOF_FAILED";
        DPOP_KEY_GENERATION_FAILED: "DPOP_KEY_GENERATION_FAILED";
        DPOP_KEY_STORAGE_FAILED: "DPOP_KEY_STORAGE_FAILED";
        DPOP_KEY_RETRIEVAL_FAILED: "DPOP_KEY_RETRIEVAL_FAILED";
        DPOP_NONCE_MISMATCH: "DPOP_NONCE_MISMATCH";
        DPOP_INVALID_TOKEN_TYPE: "DPOP_INVALID_TOKEN_TYPE";
        DPOP_MISSING_PARAMETER: "DPOP_MISSING_PARAMETER";
        DPOP_CLEAR_KEY_FAILED: "DPOP_CLEAR_KEY_FAILED";
        UNKNOWN_DPOP_ERROR: "UNKNOWN_DPOP_ERROR";
    } = ...

    Platform-agnostic error code constants for DPoP (Demonstrating Proof-of-Possession) operations.

    Use these constants for type-safe error handling when working with DPoP-bound tokens. DPoP enhances OAuth 2.0 security by binding tokens to cryptographic keys. Each constant corresponds to a specific error type in the DPoPError.type property.

    Type Declaration

    • ReadonlyDPOP_GENERATION_FAILED: "DPOP_GENERATION_FAILED"

      Failed to generate DPoP proof JWT

    • ReadonlyDPOP_PROOF_FAILED: "DPOP_PROOF_FAILED"

      DPoP proof validation or creation failed

    • ReadonlyDPOP_KEY_GENERATION_FAILED: "DPOP_KEY_GENERATION_FAILED"

      Failed to generate DPoP key pair

    • ReadonlyDPOP_KEY_STORAGE_FAILED: "DPOP_KEY_STORAGE_FAILED"

      Failed to store DPoP key securely (keychain/keystore)

    • ReadonlyDPOP_KEY_RETRIEVAL_FAILED: "DPOP_KEY_RETRIEVAL_FAILED"

      Failed to retrieve stored DPoP key

    • ReadonlyDPOP_NONCE_MISMATCH: "DPOP_NONCE_MISMATCH"

      DPoP nonce mismatch - server rejected the proof

    • ReadonlyDPOP_INVALID_TOKEN_TYPE: "DPOP_INVALID_TOKEN_TYPE"

      Invalid token type for DPoP operation

    • ReadonlyDPOP_MISSING_PARAMETER: "DPOP_MISSING_PARAMETER"

      Required DPoP parameter is missing

    • ReadonlyDPOP_CLEAR_KEY_FAILED: "DPOP_CLEAR_KEY_FAILED"

      Failed to clear/delete DPoP key

    • ReadonlyUNKNOWN_DPOP_ERROR: "UNKNOWN_DPOP_ERROR"

      Unknown or uncategorized DPoP error

    import { DPoPError, DPoPErrorCodes } from 'react-native-auth0';

    try {
    const headers = await auth0.getDPoPHeaders({
    url: 'https://api.example.com/data',
    method: 'GET',
    accessToken: credentials.accessToken,
    tokenType: credentials.tokenType
    });
    } catch (e) {
    if (e instanceof DPoPError) {
    switch (e.type) {
    case DPoPErrorCodes.DPOP_KEY_GENERATION_FAILED:
    // Failed to generate DPoP key pair
    break;
    case DPoPErrorCodes.DPOP_PROOF_FAILED:
    // Failed to create DPoP proof
    break;
    }
    }
    }