API reference#
Summary#
OIDC Async client. |
|
OIDC client. |
|
FastAPI dependency class for OpenID Connect (OIDC) access token validation. |
|
FastAPI dependency class for OpenID Connect (OIDC) access token validation for WebSocket connections. |
|
OpenID Connect set of standard claims about the profile information of the end-user. |
Raised when no issuer is provided but is required for the operation. |
|
Raised when no issuer or audience is provided but is required for the operation. |
Extract the first subprotocol that matches the specified prefix from the WebSocket’s subprotocols list. |
|
Decode a base64-encoded token. |
|
Encode a token using base64 encoding. |
Description#
IAM OIDC package.
This package provides OAuth2 and OpenID Connect (OIDC) capabilities, enabling seamless integration of authentication and authorization features.
The package is built on top of Authlib and provides both synchronous and asynchronous OIDC clients, FastAPI dependencies for token validation, and utility functions for token handling.
Module detail#
- oidc.get_websocket_subprotocol(websocket: fastapi.WebSocket, subprotocol_prefix: str = DEFAULT_SUBPROTOCOL_PREFIX) str | None#
Extract the first subprotocol that matches the specified prefix from the WebSocket’s subprotocols list.
- oidc.decode_base64_token(encoded_token: str) str#
Decode a base64-encoded token.
- Parameters:
- encoded_token: str
The base64-encoded token to decode.
- Returns:
strThe decoded token.
- Raises:
ValueErrorIf the token cannot be decoded.
- oidc.encode_base64_token(token: str) str#
Encode a token using base64 encoding.
- Parameters:
- token: str
The token to encode.
- Returns:
strThe base64-encoded token.
- oidc.DEFAULT_SUBPROTOCOL_PREFIX = 'saf.auth.bearer.'#