fastmcp.server.auth.oidc_proxy
OIDC Proxy Provider for FastMCP.
This provider acts as a transparent proxy to an upstream OIDC compliant Authorization
Server. It leverages the OAuthProxy class to handle Dynamic Client Registration and
forwarding of all OAuth flows.
This implementation is based on:
OpenID Connect Discovery 1.0 - https://openid.net/specs/openid-connect-discovery-1_0.html
OAuth 2.0 Authorization Server Metadata - https://datatracker.ietf.org/doc/html/rfc8414
Classes
OIDCConfiguration
OIDC Configuration.
Methods:
get_oidc_configuration
config_url
: The OIDC config URLstrict
: The strict flag for the configurationtimeout_seconds
: HTTP request timeout in seconds
OIDCProxy
OAuth provider that wraps OAuthProxy to provide configuration via an OIDC configuration URL.
This provider makes it easier to add OAuth protection for any upstream provider
that is OIDC compliant.
Methods:
get_oidc_configuration
config_url
: The OIDC configuration URLstrict
: The strict flag for the configurationtimeout_seconds
: HTTP request timeout in seconds
get_token_verifier
algorithm
: Optional token verifier algorithmaudience
: Optional token verifier audiencerequired_scopes
: Optional token verifier required_scopestimeout_seconds
: HTTP request timeout in seconds