Lightweight JWT verification for microservices powered by AuthFort.
Install
pip install authfort-service[fastapi]
Quick Start
from authfort_service import ServiceAuth
from fastapi import FastAPI, Depends
service = ServiceAuth(
jwks_url="https://auth.example.com/.well-known/jwks.json",
issuer="authfort",
)
app = FastAPI()
@app.get("/api/data")
async def protected(user=Depends(service.current_user)):
return {"user_id": user.sub, "roles": user.roles}
@app.get("/api/admin")
async def admin_only(user=Depends(service.require_role("admin"))):
return {"message": "admin access"}
Features
- JWKS fetching with automatic caching and refresh
- JWT signature verification (RS256)
- Token introspection client (optional real-time validation)
- FastAPI integration (current_user, require_role dependencies)
- No database required
With Introspection
service = ServiceAuth(
jwks_url="https://auth.example.com/.well-known/jwks.json",
issuer="authfort",
introspect_url="https://auth.example.com/auth/introspect",
introspect_secret="shared-secret",
)
# Real-time validation (checks ban status, token version, fresh roles)
result = await service.introspect(token)
License
Metadata
Release files for authfort-service 0.0.32
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| authfort_service-0.0.32.tar.gz | 11.1 kB | Without provenance | Details for authfort_service-0.0.32.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| authfort_service-0.0.32-py3-none-any.whl | Python 3 | none | any | Details for authfort_service-0.0.32-py3-none-any.whl |
Total release size: 20.8 kB
Release files / authfort_service-0.0.32.tar.gz
| Download URL | authfort_service-0.0.32.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b3d0a37e79f08af7740a56c50b4b801e96c1a6a737719da305a785f47f0ba61
|
|
BLAKE2b-256 checksum How to use checksums |
1d2d41ff0d480bf8d55bba9e5b9eb051a1b189452bd7e155b5c6d329259aa14f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / authfort_service-0.0.32-py3-none-any.whl
| Download URL | authfort_service-0.0.32-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b5ef54a70601fafde3f9bccbf5a4ac141b7a4153ef478f2bdb560beb14d2e160
|
|
BLAKE2b-256 checksum How to use checksums |
1ea69f477a85a07cfdb3d61bbc7db52a3445272e4493f78246d9a01eb512a769
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for authfort-service 0.0.32
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.