Skip to main content
agentonboard-sdk[django] provides @require_agent_token for synchronous and asynchronous Django views. It verifies the Bearer token locally against AgentOnboard’s public JWKS, resolves your Django user record, and returns a JsonResponse with 401, 403, or 500 on failure.

Copy-paste agent prompt


1. Install the Python SDK


2. Guard your Django views

Pass resolver to look up your Django User by email. @require_agent_token attaches request.agent_user and request.agent_identity to HttpRequest, and passes agent_user as a keyword argument when declared in your view signature:
notes/views.py
Async Django views supported@require_agent_token inspects your view function with inspect.iscoroutinefunction. When you define async def create_note(request, agent_user):, the decorator runs async JWKS fetching and awaits async resolver callbacks automatically.

3. Enabling explicit agent signup (POST /api/signup)

Keep @require_agent_token(..., auto_create=False) on all regular views and add one dedicated POST /api/signup view using create_agent_account:
notes/views.py

4. Test with curl

Mint a 5-minute test token using POST /api/v1/token/exchange and call your Django endpoint:

FastAPI

Testing & Production