FastAPI Auth OpenID Connect
Project description
FastAPI OIDC Security
This library allows your server-side application to check credentials with ease using OpenID Connect token flows. Use it with Firebase, Keycloak, Authentik or other OIDC providers.
Simple usage
from fastapi import FastAPI
from fastapi_auth_oidc import OIDCProvider, IDToken
app = FastAPI()
auth_user = OIDCProvider(
configuration_uri="https://example.domain/issuer/.well-known/openid-configuration",
client_id="my-client",
)
@app.get("/me")
def get_me(
user: Annotated[IDToken | None, Depends(auth_user)],
):
return user.model_dump() if user else {}
You must process errors and absent token manually!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastapi_auth_oidc-0.1.3.tar.gz
(36.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_auth_oidc-0.1.3.tar.gz.
File metadata
- Download URL: fastapi_auth_oidc-0.1.3.tar.gz
- Upload date:
- Size: 36.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
581a3eea2b7caf12da632d9caf642b33c5ebe5696e8e5d193576903f71e27297
|
|
| MD5 |
da39fa2dd2745874e099b685753a5fb3
|
|
| BLAKE2b-256 |
455b2d20dc69925d9dfeb1127d3b4be95238f72d949a0cbbc70ebd0b5d7d0001
|
File details
Details for the file fastapi_auth_oidc-0.1.3-py3-none-any.whl.
File metadata
- Download URL: fastapi_auth_oidc-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baae1fb50b32e64b6022d0fdb4a4fd65e3382f3b077b97404d5df2cb5cdc2cc4
|
|
| MD5 |
72a84646b758a8ebdb6b1bfe1b8deaba
|
|
| BLAKE2b-256 |
3feed9e5dc37d7335776bfb6960f911573c3694653fb6ca2ae305f0f4991c795
|