Building Anzen: What I Learned About Token Vault the Hard Way
When I started building Anzen for the Authorised to Act hackathon, I thought Token Vault would be the easy part. I was wrong. The concept is simple and powerful: instead of your AI agent holding OA...

Source: DEV Community
When I started building Anzen for the Authorised to Act hackathon, I thought Token Vault would be the easy part. I was wrong. The concept is simple and powerful: instead of your AI agent holding OAuth tokens for GitHub, Gmail, and Slack, Auth0 holds them in a secure vault. The agent requests a scoped token when it needs one, uses it, and the token is gone. No credentials stored in your app. No breach risk. No all-or-nothing access. The implementation is where it gets interesting. The first thing I discovered is that nextjs-auth0 v4 is a completely different SDK from v3. The familiar handleAuth function is gone. The middleware file convention changed. Environment variable names changed. Even the callback URL path changed from /api/auth/callback to /auth/callback. None of this was obvious from the documentation. The second discovery was about the token exchange flow itself. Calling getAccessToken() returns an Auth0 JWT — not the GitHub or Slack token you actually need. To get the provide