@@ -61,6 +61,12 @@ export const CredentialsManagerErrorCodes = {
6161 INCOMPATIBLE_DEVICE : 'INCOMPATIBLE_DEVICE' ,
6262 /** Cryptographic operation failed */
6363 CRYPTO_EXCEPTION : 'CRYPTO_EXCEPTION' ,
64+ /** DPoP key pair is no longer available in the device keystore/keychain - re-authentication required */
65+ DPOP_KEY_MISSING : 'DPOP_KEY_MISSING' ,
66+ /** Credentials are DPoP-bound but the client was not configured with DPoP */
67+ DPOP_NOT_CONFIGURED : 'DPOP_NOT_CONFIGURED' ,
68+ /** Current DPoP key pair does not match the one used when credentials were saved - re-authentication required */
69+ DPOP_KEY_MISMATCH : 'DPOP_KEY_MISMATCH' ,
6470 /** Unknown or uncategorized error */
6571 UNKNOWN_ERROR : 'UNKNOWN_ERROR' ,
6672} as const ;
@@ -80,6 +86,11 @@ const ERROR_CODE_MAP: Record<string, string> = {
8086 NO_NETWORK : CredentialsManagerErrorCodes . NO_NETWORK ,
8187 API_ERROR : CredentialsManagerErrorCodes . API_ERROR ,
8288
89+ // --- DPoP credential state errors ---
90+ DPOP_KEY_MISSING : CredentialsManagerErrorCodes . DPOP_KEY_MISSING ,
91+ DPOP_NOT_CONFIGURED : CredentialsManagerErrorCodes . DPOP_NOT_CONFIGURED ,
92+ DPOP_KEY_MISMATCH : CredentialsManagerErrorCodes . DPOP_KEY_MISMATCH ,
93+
8394 // --- API Credentials (MRRT) specific codes ---
8495 API_EXCHANGE_FAILED : CredentialsManagerErrorCodes . API_EXCHANGE_FAILED ,
8596 // --- Web (@auth0/auth0-spa-js) mappings ---
@@ -175,6 +186,11 @@ const ERROR_CODE_MAP: Record<string, string> = {
175186 * - `NO_NETWORK`: Network connectivity issue
176187 * - `API_ERROR`: Generic API error
177188 *
189+ * ### DPoP Credential State:
190+ * - `DPOP_KEY_MISSING`: DPoP key pair no longer available in keystore/keychain
191+ * - `DPOP_NOT_CONFIGURED`: Credentials are DPoP-bound but client not configured with DPoP
192+ * - `DPOP_KEY_MISMATCH`: Current DPoP key pair doesn't match the one used when credentials were saved
193+ *
178194 * ### Biometric Authentication:
179195 * - `BIOMETRICS_FAILED`: Biometric authentication failed
180196 * - `INCOMPATIBLE_DEVICE`: Device incompatible with secure storage
@@ -285,6 +301,9 @@ export class CredentialsManagerError extends AuthError {
285301 * - `NO_REFRESH_TOKEN`: Refresh token is not available
286302 * - `RENEW_FAILED`: Token renewal failed
287303 * - `API_EXCHANGE_FAILED`: API credentials exchange failed (MRRT)
304+ * - `DPOP_KEY_MISSING`: DPoP key pair no longer in keystore/keychain
305+ * - `DPOP_NOT_CONFIGURED`: Credentials DPoP-bound but client not configured
306+ * - `DPOP_KEY_MISMATCH`: DPoP key pair doesn't match saved credentials
288307 * - `STORE_FAILED`: Failed to store credentials
289308 * - `REVOKE_FAILED`: Failed to revoke refresh token
290309 * - `LARGE_MIN_TTL`: Requested minimum TTL exceeds token lifetime
0 commit comments