Commit cca09ff
fix(fastmcp): consolidate ApiClient instances in auth0.ts (#38)
Previously created two separate ApiClient instances with different audiences:
- apiClient with AUTH0_AUDIENCE (correct)
- exchangeClient with API_AUTH0_AUDIENCE (incorrect)
The audience parameter in ApiClient constructor is for validating incoming
tokens, not for specifying target audience of exchanged tokens. Both token
verification and exchange should use the same client configured with the
MCP's own audience (AUTH0_AUDIENCE).
Changes:
- Removed exchangeClient instance
- Added client credentials to single apiClient
- Updated exchangeCustomToken to use apiClient
- Added comments clarifying audience usage in token exchange
- Target audience (API_AUTH0_AUDIENCE) correctly specified in getTokenByExchangeProfile() call
Fixes: AIDX-314
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 995b11a commit cca09ff
1 file changed
+6
-8
lines changedLines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
34 | 30 | | |
35 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
36 | 34 | | |
37 | | - | |
| 35 | + | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
0 commit comments