You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Maintains full backward compatibility with M2M authentication
195
195
- Automatically includes appropriate headers based on auth method
196
196
197
-
### 1. Machine-to-Machine (M2M) Authentication
197
+
### 1. Machine-to-Machine Authentication
198
+
199
+
Cognito supports machine-to-machine authentication, enabling Agents to have their own identity separate from user identity.
200
+
201
+
#### Implementation Details:
202
+
- Reference: [AWS Blog on Machine-to-Machine Authentication](https://aws.amazon.com/blogs/mt/configuring-machine-to-machine-authentication-with-amazon-cognito-and-amazon-api-gateway-part-2/)
203
+
- Agents are treated as App Clients (Cognito terminology)
204
+
- MCP Server(s) function as resource servers
205
+
206
+
#### Authentication Flow:
207
+
1. Agent startup:
208
+
- Configured with client ID, client secret, and a set of scopes
209
+
- Requests scopes (e.g., MCP Registry with tool finder and basic MCP servers)
210
+
2. Cognito issues a JWT token
211
+
3. Agent includes the JWT token in MCP headers
212
+
4. Auth server on Nginx side:
213
+
- Retrieves JWT token
214
+
- Calls Cognito to validate token and get allowed scopes
215
+
- Returns 200 or 403 based on:
216
+
- URL (MCP server)
217
+
- Payload (Tools)
218
+
- Agent's allowed scopes
219
+
220
+
#### Advantages
221
+
1. Leverages existing Cognito user identities and groups
222
+
2. No need to manage separate M2M credentials for user-initiated actions
223
+
3. Maintains user context throughout the session
224
+
4. Compatible with existing web-based authentication flow
225
+
5. Auth server handles both authentication methods transparently
198
226
199
227
### 2. Session Cookie Authentication
200
228
@@ -252,36 +280,6 @@ The auth server validates session cookies alongside JWT tokens:
- Falls back to JWT validation if no valid cookie found
254
282
255
-
#### Advantages
256
-
1. Leverages existing Cognito user identities and groups
257
-
2. No need to manage separate M2M credentials for user-initiated actions
258
-
3. Maintains user context throughout the session
259
-
4. Compatible with existing web-based authentication flow
260
-
5. Auth server handles both authentication methods transparently
261
-
262
-
### 3. Machine-to-Machine Authentication
263
-
264
-
Cognito supports machine-to-machine authentication, enabling Agents to have their own identity separate from user identity.
265
-
266
-
#### Implementation Details:
267
-
- Reference: [AWS Blog on Machine-to-Machine Authentication](https://aws.amazon.com/blogs/mt/configuring-machine-to-machine-authentication-with-amazon-cognito-and-amazon-api-gateway-part-2/)
268
-
- Agents are treated as App Clients (Cognito terminology)
269
-
- MCP Server(s) function as resource servers
270
-
271
-
#### Authentication Flow:
272
-
1. Agent startup:
273
-
- Configured with client ID, client secret, and a set of scopes
274
-
- Requests scopes (e.g., MCP Registry with tool finder and basic MCP servers)
275
-
2. Cognito issues a JWT token
276
-
3. Agent includes the JWT token in MCP headers
277
-
4. Auth server on Nginx side:
278
-
- Retrieves JWT token
279
-
- Calls Cognito to validate token and get allowed scopes
280
-
- Returns 200 or 403 based on:
281
-
- URL (MCP server)
282
-
- Payload (Tools)
283
-
- Agent's allowed scopes
284
-
285
283
#### Advantages:
286
284
- Simpler implementation compared to user-based authentication
287
285
- Enables fine-grained control over Agent permissions
0 commit comments