troubleshooting-authentication

Installation
SKILL.md

Authentication Troubleshooting

Architecture

  1. Browser → MSAL.js (PKCE flow) → JWT with Chat.ReadWrite scope
  2. Frontend → Backend (JWT Bearer token)
  3. 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)

Backend: JWT Validation

Related skills
Installs
10
GitHub Stars
95
First Seen
Feb 22, 2026