agentity-auth
OIDC authentication plugin for Agentity. Verify human ownership of agent identities via Google, GitHub, Apple, and Microsoft login.
Installation
pip install agentity-auth
Usage
Mount the router on your FastAPI application:
from fastapi import FastAPI
from agentity_auth import router as auth_router
app = FastAPI()
app.include_router(auth_router)
Configuration
Set OAuth2 credentials as environment variables:
GOOGLE_CLIENT_ID=xxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxx
GITHUB_CLIENT_ID=Ov23lixxx
GITHUB_CLIENT_SECRET=xxx
APPLE_CLIENT_ID=com.example
APPLE_CLIENT_SECRET=xxx # client secret generated from private key
MICROSOFT_CLIENT_ID=xxx
MICROSOFT_CLIENT_SECRET=xxx
All providers are optional — only configure the ones you need.
Endpoints
| Method | Path | Description |
|---|---|---|
GET |
/auth/login/{provider} |
Redirect to OAuth2 consent screen |
GET |
/auth/callback/{provider} |
Exchange auth code for session |
GET |
/auth/session/{token} |
Get owner info from session token |
GET |
/auth/me |
Get current owner from Agentity-Session header |
POST |
/auth/register-verified |
Verify owner_did matches session |
Integration with registry
from fastapi import FastAPI
from agentity_registry.main import create_app
from agentity_auth import router as auth_router
app = create_app() # creates FastAPI with /register, /did, /revoke, etc.
app.include_router(auth_router) # adds /auth/login, /auth/callback, /auth/me
Supported providers
| Provider | Scopes | User info |
|---|---|---|
openid email profile |
Email, name, Google profile | |
| GitHub | read:user user:email |
Email, name, GitHub profile |
| Apple | name email |
Email, name (Sign in with Apple) |
| Microsoft | openid email profile User.Read |
Email, name, MS profile |
Session model
class OwnerInfo(BaseModel):
did: str # did:agentity:human:{fingerprint}
provider: str # google | github | apple | microsoft
provider_sub: str # Provider's user ID
email: str
name: str
verified: bool
License: Apache 2.0
Metadata
Release files for agentity-auth 0.1.1
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 | |
|---|---|---|---|---|
| agentity_auth-0.1.1.tar.gz | 5.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentity_auth-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.5 kB
Release files / agentity_auth-0.1.1.tar.gz
| Download URL | agentity_auth-0.1.1.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22552a88dab80a68560600173cf0fbd30c5ba19e44f7a4c6328346d076c23530
|
|
BLAKE2b-256 checksum How to use checksums |
3d86409e70c5c5e70d1601c12dbedd85bca5d84ce326fb58fe0af3743a89bcf1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / agentity_auth-0.1.1-py3-none-any.whl
| Download URL | agentity_auth-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e8e8a0d15b151f3b62a92404606a9d23a3c60bfd1afecc4860a4decc57cfdf0
|
|
BLAKE2b-256 checksum How to use checksums |
a098be53dbf2fd2fd63e6a1294fa5a9bc4a91478cc47317404dd8e96ef52f59c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for agentity-auth 0.1.1
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.