troubleshooting-authentication
Installation
SKILL.md
Authentication Troubleshooting
Architecture
- Browser → MSAL.js (PKCE flow) → JWT with
Chat.ReadWritescope - Frontend → Backend (JWT Bearer token)
- Backend → Foundry Agent Service (ManagedIdentityCredential)
Common Issues
| Issue | Cause | Fix |
|---|---|---|
401 on /api/* |
Token missing scope | Verify Chat.ReadWrite scope in token |
ManagedIdentityCredential error locally |
Wrong environment | Set ASPNETCORE_ENVIRONMENT=Development |
| Token popup blocked | Browser settings | Allow popups for localhost |
| Silent token fails | No cached token | Fallback to popup (handled by useAuth) |