SignInService / Client / exceptions / AccessDeniedException

AccessDeniedException

class SignInService.Client.exceptions.AccessDeniedException

Error thrown for access denied scenarios with flexible HTTP status mapping

Runtime HTTP Status Code Mapping:

  • HTTP 401 (Unauthorized): TOKEN_EXPIRED, AUTHCODE_EXPIRED

  • HTTP 403 (Forbidden): USER_CREDENTIALS_CHANGED, INSUFFICIENT_PERMISSIONS

The specific HTTP status code is determined at runtime based on the error enum value. Consumers should use the error field to determine the specific access denial reason.

Example

try:
  ...
except client.exceptions.AccessDeniedException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'error': 'TOKEN_EXPIRED'|'USER_CREDENTIALS_CHANGED'|'INSUFFICIENT_PERMISSIONS'|'AUTHCODE_EXPIRED'|'server_error'|'INVALID_REQUEST',
    'message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    Error thrown for access denied scenarios with flexible HTTP status mapping

    Runtime HTTP Status Code Mapping:

    • HTTP 401 (Unauthorized): TOKEN_EXPIRED, AUTHCODE_EXPIRED

    • HTTP 403 (Forbidden): USER_CREDENTIALS_CHANGED, INSUFFICIENT_PERMISSIONS

    The specific HTTP status code is determined at runtime based on the error enum value. Consumers should use the error field to determine the specific access denial reason.

    • error (string) –

      OAuth 2.0 error code indicating the specific type of access denial Can be TOKEN_EXPIRED, AUTHCODE_EXPIRED, USER_CREDENTIALS_CHANGED, or INSUFFICIENT_PERMISSIONS

    • message (string) –

      Detailed message explaining the access denial Provides specific information about why access was denied

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.