Errors and Troubleshooting

Use authentication error details to diagnose sign-in and token problems. Distinguish SDK error objects from the JSON responses returned by REST endpoints.

Topics:

Authentication Error Format

Authentication REST endpoints can return an error message in this JSON form:

{
  "error": "<error message>"
}

Some REST responses also include a code field. Response fields depend on the endpoint.

The relational JavaScript SDK returns { data, error }. When error is present, inspect its message, status, and code before using data. For an MFA-required sign-in, continue the MFA challenge instead of treating the user as signed in. See Authentication Error Handling.

Common Authentication Errors

Error Scenario Cause Resolution
Invalid JWT token Token is expired, malformed, or unverifiable Re-authenticate and obtain a valid token
Unsupported sign-in provider The provider is unavailable or not configured for the project Use a provider configured for the project and the identifier expected by the SDK API
Token verification failure Signature cannot be verified using backend crypto packages Check token issuer and signing method
Unauthorized database operation The request does not have the required data grants Check the request’s authentication state and the project’s data roles and data grants