Skip to content

Commit 78a7d1c

Browse files
committed
Deduplicate OAuth provider replacement docs
Consolidate three redundant 'Production Replacement' sections into a single canonical location in docs/oauth-architecture-patterns.md. Both server READMEs now point to this guide.
1 parent a3ecfee commit 78a7d1c

3 files changed

Lines changed: 51 additions & 31 deletions

File tree

auth-server/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,13 @@ npm run typecheck # Type checking
9898
npm run build # Build to dist/
9999
```
100100

101-
## Production Replacement
101+
## Production Usage
102102

103-
Commercial OAuth providers supporting RFC 7662 introspection:
104-
- Auth0, Okta, Azure AD/Microsoft Entra
105-
- AWS Cognito, Google Identity Platform
106-
- GitHub OAuth
103+
This demo server should be replaced with a commercial OAuth provider in production.
107104

108-
The MCP server integrates with any RFC 7662-compliant provider.
105+
See [OAuth Architecture Patterns](../docs/oauth-architecture-patterns.md#using-a-commercial-auth-provider) for detailed integration guidance.
106+
107+
**Supported providers:** Auth0, Okta, Azure AD, AWS Cognito, Google, GitHub, and any RFC 7662-compliant OAuth provider.
109108

110109
## Redis Data
111110

docs/oauth-architecture-patterns.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,49 @@ The current implementation demonstrates this pattern with separate authorization
4141

4242
### Using a Commercial Auth Provider
4343

44-
Replacing the demo auth server with a commercial provider:
45-
46-
1. **Configure provider**: Set up OAuth app in commercial provider (e.g. Auth0/Okta)
47-
2. **Update metadata URL**: Point to provider's discovery endpoint
48-
3. **Configure introspection**: Set up token validation
49-
4. **Update redirect URIs**: Configure allowed callbacks
50-
5. **Migrate users**: Import existing users if needed
51-
6. **Test integration**: Verify full OAuth flow
44+
The demo auth server should be replaced with a commercial OAuth provider in production.
45+
46+
**Supported providers:**
47+
- Auth0, Okta, Azure AD/Microsoft Entra
48+
- AWS Cognito, Google Identity Platform
49+
- GitHub OAuth
50+
- Any RFC 7662-compliant OAuth provider
51+
52+
#### Integration Steps
53+
54+
1. **Configure provider**: Set up OAuth app in your provider
55+
- Register your MCP server as a resource server
56+
- Configure allowed redirect URIs
57+
- Enable token introspection endpoint
58+
59+
2. **Update MCP server environment** (`mcp-server/.env`):
60+
```bash
61+
AUTH_SERVER_URL=https://your-tenant.auth0.com
62+
# or https://your-domain.okta.com
63+
# or https://login.microsoftonline.com/your-tenant
64+
```
65+
66+
3. **Adjust token introspection** if needed (`mcp-server/src/auth/external-verifier.ts`):
67+
```typescript
68+
// Most providers use RFC 7662 standard format, but some may differ
69+
const response = await fetch(`${this.authServerUrl}/oauth/introspect`, {
70+
method: 'POST',
71+
headers: {
72+
'Content-Type': 'application/x-www-form-urlencoded',
73+
// Some providers require authentication here
74+
'Authorization': `Basic ${Buffer.from('client_id:client_secret').toString('base64')}`
75+
},
76+
body: `token=${token}`
77+
});
78+
```
79+
80+
4. **Update redirect URIs**: Configure your provider's allowed callbacks to match your deployment URLs
81+
82+
5. **Test the integration**: Verify the full OAuth flow with your provider
83+
84+
**Note on token introspection:** Most providers use the RFC 7662 standard format. If your provider uses a non-standard format, you may need to adjust the response parsing in `mcp-server/src/auth/external-verifier.ts`.
85+
86+
The MCP server code otherwise remains unchanged - it only needs to know where to validate tokens.
5287

5388
---
5489

mcp-server/README.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -115,25 +115,11 @@ npm run typecheck # Type checking
115115
npm run build # Build to dist/
116116
```
117117

118-
## Production Adaptation
118+
## Production Usage
119119

120-
To use a commercial OAuth provider:
120+
To use a commercial OAuth provider instead of the demo auth server, see [OAuth Architecture Patterns](../docs/oauth-architecture-patterns.md#using-a-commercial-auth-provider) for detailed integration guidance.
121121

122-
1. Update `.env` with provider URL:
123-
```bash
124-
AUTH_SERVER_URL=https://your-tenant.auth0.com
125-
```
126-
127-
2. Modify `src/auth/external-verifier.ts` for provider-specific introspection:
128-
```typescript
129-
const response = await fetch(`${this.authServerUrl}/oauth/introspect`, {
130-
// Add provider-specific authentication
131-
})
132-
```
133-
134-
3. Adjust response parsing if the introspection format differs from RFC 7662 standard
135-
136-
The MCP server code otherwise remains unchanged.
122+
**Summary:** Update `AUTH_SERVER_URL` in `.env` to point to your provider. You may need to adjust `src/auth/external-verifier.ts` for provider-specific introspection formats, but the MCP server code otherwise remains unchanged.
137123

138124
## References
139125

0 commit comments

Comments
 (0)