Skip to main content

FastAPI middleware to authenticate Github OIDC Tokens

Project description

FastAPI Github OIDC Middleware

FastAPI compatible middleware to authenticate Github OIDC Tokens

Want people to use your thing? Great! So we do. Make is easy!

Github OIDC is a secure authentication mechanism with near-zero configuration required for many applications.

Server Side

uv add "fastapi-github-oidc[server]"

from fastapi import Security, FastAPI
from github_oidc.server import GithubOIDC, GithubOIDCClaims

app = FastAPI()

@app.get("/")
async def root(claims: GithubOIDCClaims = Security(GithubOIDC())):
    return claims

Client Side

uv add "fastapi-github-oidc"

You must also have either httpx or requests installed

from github_oidc.client import get_actions_header

response = httpx.get(
    "https://atopile.io",
    headers=get_actions_header("atopile.io"),
)
response.raise_for_status()

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_github_oidc-0.2.1.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_github_oidc-0.2.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_github_oidc-0.2.1.tar.gz.

File metadata

  • Download URL: fastapi_github_oidc-0.2.1.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fastapi_github_oidc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 64892ae2c031cc04d1bd353a5b3d477433197a9a6b4e1dee04e0b798b7005a8f
MD5 2da06348b8fbadb075aba3eb966437fe
BLAKE2b-256 e4aba6909604af8c231cfd19531a3e78500cd1d7baac6524f109d0b609096e20

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_github_oidc-0.2.1.tar.gz:

Publisher: release.yml on atopile/fastapi-github-oidc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_github_oidc-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_github_oidc-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e24102c920aaf4d7349e302db9241b6136d6648b13a52de109cb10e17b779fc
MD5 02d30f767e948723abaf02d0a2104667
BLAKE2b-256 a655682fdbb38620861a3e9d6bead034ef02a0b70eb45d70e480e5e0bc3deb66

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_github_oidc-0.2.1-py3-none-any.whl:

Publisher: release.yml on atopile/fastapi-github-oidc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page