Skip to content

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)

from py_identity_model import get_discovery_document, DiscoveryDocumentRequest

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
Device Authorization Device Authorization Grant (RFC 8628)
FAPI 2.0 FAPI 2.0 Security Profile compliance validation
HTTP Client Dependency injection for HTTP client management
Introspection Token Introspection (RFC 7662)
JAR JWT Secured Authorization Request (RFC 9101)
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