OidcDependency#
- class ansys.iam.oidc.OidcDependency(oidc_issuer: str | None = None, audience: str | None = None, *, auto_error: bool = True)#
Bases:
fastapi.security.OpenIdConnectFastAPI dependency class for OpenID Connect (OIDC) access token validation.
Overview#
Get the asynchronous OIDC client. |
|
Get a synchronous OIDC client. |
Extract and validate the access token from the HTTP request. |
Import detail#
from ansys.iam.oidc import OidcDependency
Property detail#
- property OidcDependency.async_client: ansys.iam.oidc._client.AsyncOidcClient#
Get the asynchronous OIDC client.
- Returns:
AsyncOidcClientThe asynchronous OIDC client instance.
- property OidcDependency.client: ansys.iam.oidc._client.OidcClient#
Get a synchronous OIDC client.
- Returns:
OidcClientA new synchronous OIDC client instance.
Method detail#
- async OidcDependency.__call__(request: starlette.requests.Request) str | None#
Extract and validate the access token from the HTTP request.
- Parameters:
- request
Request The incoming HTTP request.
- request
- Returns:
- Raises:
HTTPExceptionIf auto_error is True and authentication fails (missing token, invalid scheme, or token validation fails).