Agentity OIDC authentication — verify human owners via Google, GitHub, Apple, Microsoft
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 agentity_auth-0.1.1.tar.gz.
File metadata
- Download URL: agentity_auth-0.1.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22552a88dab80a68560600173cf0fbd30c5ba19e44f7a4c6328346d076c23530
|
|
| MD5 |
517ebd878053910eb4766557be1ffc8d
|
|
| BLAKE2b-256 |
3d86409e70c5c5e70d1601c12dbedd85bca5d84ce326fb58fe0af3743a89bcf1
|
File details
Details for the file agentity_auth-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agentity_auth-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e8e8a0d15b151f3b62a92404606a9d23a3c60bfd1afecc4860a4decc57cfdf0
|
|
| MD5 |
fdc8d332c565399d336c3b582259e0d6
|
|
| BLAKE2b-256 |
a098be53dbf2fd2fd63e6a1294fa5a9bc4a91478cc47317404dd8e96ef52f59c
|