API Reference¶
Auto-generated reference documentation for the py-identity-model public API.
The library provides both synchronous and asynchronous APIs. All models (requests, responses, config) are shared between the two.
Sync API (default)¶
Async API¶
from py_identity_model.aio import get_discovery_document
from py_identity_model import DiscoveryDocumentRequest
Modules¶
| Module | Description |
|---|---|
| Auth Code + PKCE | Authorization code grant with PKCE (RFC 7636) |
| Authorize Callback | Authorization callback parsing and state validation |
| Claims Validation | Injectable, composable application-policy claims validators |
| Configuration | Typed, fail-closed configuration with pluggable sources |
| Device Authorization | Device Authorization Grant (RFC 8628) |
| Dynamic Client Registration | Client registration and management (RFC 7591 / 7592) |
| FAPI 2.0 | FAPI 2.0 Security Profile compliance validation |
| HTTP Client | Dependency injection for HTTP client management |
| ID Token Validation | OIDC ID-token profile validation (nonce, azp, at_hash, c_hash) |
| Introspection | Token Introspection (RFC 7662) |
| JAR | JWT Secured Authorization Request (RFC 9101) |
| JARM | JWT-Secured Authorization Response Mode (signed) |
| Logout | RP-initiated logout and back-channel logout token validation |
| Mutual TLS | mTLS client auth and certificate-bound tokens (RFC 8705) |
| PAR | Pushed Authorization Requests (RFC 9126) |
| DPoP | Demonstrating Proof of Possession (RFC 9449) |
| Discovery | OpenID Connect Discovery 1.0 document fetching |
| Discovery Policy | Configurable security policy for discovery validation |
| JWKS | JSON Web Key Set (RFC 7517) operations |
| Refresh Token | Refresh Token Grant (RFC 6749 Section 6) |
| Revocation | Token Revocation (RFC 7009) |
| Token Client | OAuth 2.0 token endpoint (client credentials) |
| Token Exchange | Token Exchange (RFC 8693) |
| Token Validation | JWT validation with auto-discovery |
| UserInfo | OpenID Connect UserInfo endpoint |
| Identity & Claims | Claims-based identity model |
| Exceptions | Exception hierarchy |