File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
examples/servers/simple-auth/mcp_simple_auth Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -113,16 +113,20 @@ async def introspect_handler(request: Request) -> Response:
113113 return JSONResponse ({"active" : False })
114114
115115 # Return token info for Resource Server
116- return JSONResponse (
117- {
118- "active" : True ,
119- "client_id" : access_token .client_id ,
120- "scope" : " " .join (access_token .scopes ),
121- "exp" : access_token .expires_at ,
122- "iat" : int (time .time ()),
123- "token_type" : "Bearer" ,
124- }
125- )
116+ response_data = {
117+ "active" : True ,
118+ "client_id" : access_token .client_id ,
119+ "scope" : " " .join (access_token .scopes ),
120+ "exp" : access_token .expires_at ,
121+ "iat" : int (time .time ()),
122+ "token_type" : "Bearer" ,
123+ }
124+
125+ # Include audience claim for RFC 8707 resource validation
126+ if access_token .resource :
127+ response_data ["aud" ] = access_token .resource
128+
129+ return JSONResponse (response_data )
126130
127131 routes .append (
128132 Route (
You can’t perform that action at this time.
0 commit comments