Module oidc_error_extensions

Module oidc_error_extensions 

Source
Expand description

OpenID Connect Core Error Code Extensions

This module implements additional error codes for OpenID Connect, including the unmet_authentication_requirements error code and other enhanced error handling capabilities.

§Implemented Error Extensions

  • unmet_authentication_requirements - Authentication requirements not met
  • Enhanced error descriptions and URIs
  • Structured error reporting
  • Error code validation and mapping
  • Custom error code mappings for extensible error handling

§Custom Error Mappings

The OidcErrorManager supports custom error code mappings that allow:

  • Mapping custom string identifiers to standard or extended error codes
  • Runtime extensibility for domain-specific error codes
  • Override standard error code mappings for specialized behavior
  • Error code resolution from string identifiers

§Usage Examples

use auth_framework::server::oidc_error_extensions::{OidcErrorManager, OidcErrorCode};

let mut manager = OidcErrorManager::default();

// Add custom error mapping
manager.add_custom_error_mapping(
    "payment_required".to_string(),
    OidcErrorCode::InsufficientIdentityAssurance,
);

// Resolve error from identifier
let error_code = manager.resolve_error_code("payment_required");

// Create error response from identifier
let response = manager.create_error_response_from_identifier(
    "payment_required",
    Some("Payment verification required".to_string()),
    Some("state123".to_string()),
    std::collections::HashMap::new(),
).unwrap();

Structs§

AuthenticationRequirements
Authentication requirements details
OidcErrorManager
Error handling manager for OpenID Connect
OidcErrorResponse
OpenID Connect error response

Enums§

OidcErrorCode
Extended OpenID Connect error codes