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

    Variable CredentialsManagerErrorCodesConst

    CredentialsManagerErrorCodes: {
        INVALID_CREDENTIALS: "INVALID_CREDENTIALS";
        NO_CREDENTIALS: "NO_CREDENTIALS";
        NO_REFRESH_TOKEN: "NO_REFRESH_TOKEN";
        RENEW_FAILED: "RENEW_FAILED";
        STORE_FAILED: "STORE_FAILED";
        REVOKE_FAILED: "REVOKE_FAILED";
        LARGE_MIN_TTL: "LARGE_MIN_TTL";
        CREDENTIAL_MANAGER_ERROR: "CREDENTIAL_MANAGER_ERROR";
        BIOMETRICS_FAILED: "BIOMETRICS_FAILED";
        NO_NETWORK: "NO_NETWORK";
        API_ERROR: "API_ERROR";
        API_EXCHANGE_FAILED: "API_EXCHANGE_FAILED";
        INCOMPATIBLE_DEVICE: "INCOMPATIBLE_DEVICE";
        CRYPTO_EXCEPTION: "CRYPTO_EXCEPTION";
        UNKNOWN_ERROR: "UNKNOWN_ERROR";
    } = ...

    Platform-agnostic error code constants for Credentials Manager operations.

    Use these constants for type-safe error handling when working with credentials operations like getCredentials, saveCredentials, clearCredentials, and getApiCredentials. Each constant corresponds to a specific error type in the CredentialsManagerError.type property.

    Type Declaration

    • ReadonlyINVALID_CREDENTIALS: "INVALID_CREDENTIALS"

      Stored credentials are invalid or corrupted

    • ReadonlyNO_CREDENTIALS: "NO_CREDENTIALS"

      No credentials are stored - user needs to log in

    • ReadonlyNO_REFRESH_TOKEN: "NO_REFRESH_TOKEN"

      Refresh token is not available - ensure offline_access scope was requested

    • ReadonlyRENEW_FAILED: "RENEW_FAILED"

      Failed to refresh credentials using refresh token

    • ReadonlySTORE_FAILED: "STORE_FAILED"

      Failed to store credentials securely

    • ReadonlyREVOKE_FAILED: "REVOKE_FAILED"

      Failed to revoke refresh token

    • ReadonlyLARGE_MIN_TTL: "LARGE_MIN_TTL"

      Requested minimum TTL exceeds token lifetime

    • ReadonlyCREDENTIAL_MANAGER_ERROR: "CREDENTIAL_MANAGER_ERROR"

      Generic credentials manager error

    • ReadonlyBIOMETRICS_FAILED: "BIOMETRICS_FAILED"

      Biometric authentication failed

    • ReadonlyNO_NETWORK: "NO_NETWORK"

      Network connectivity issue

    • ReadonlyAPI_ERROR: "API_ERROR"

      Generic API error

    • ReadonlyAPI_EXCHANGE_FAILED: "API_EXCHANGE_FAILED"

      Failed to exchange refresh token for API-specific credentials (MRRT)

    • ReadonlyINCOMPATIBLE_DEVICE: "INCOMPATIBLE_DEVICE"

      Device is incompatible with secure storage requirements

    • ReadonlyCRYPTO_EXCEPTION: "CRYPTO_EXCEPTION"

      Cryptographic operation failed

    • ReadonlyUNKNOWN_ERROR: "UNKNOWN_ERROR"

      Unknown or uncategorized error

    import { CredentialsManagerError, CredentialsManagerErrorCodes } from 'react-native-auth0';

    try {
    const credentials = await auth0.credentialsManager.getCredentials();
    } catch (e) {
    if (e instanceof CredentialsManagerError) {
    switch (e.type) {
    case CredentialsManagerErrorCodes.NO_CREDENTIALS:
    // User needs to log in
    break;
    case CredentialsManagerErrorCodes.NO_REFRESH_TOKEN:
    // Request offline_access scope during login
    break;
    case CredentialsManagerErrorCodes.RENEW_FAILED:
    // Token refresh failed - may need re-authentication
    break;
    }
    }
    }