@@ -160,12 +160,11 @@ export function createTokenHandler(oauthProvider: any) {
160160}
161161
162162/**
163- * Token introspection endpoint - proxies to external OAuth provider
163+ * Token introspection endpoint - simplified for OAuth proxy pattern
164164 */
165165export function createIntrospectionHandler ( oauthProvider ?: any ) {
166166 return async ( req : Request , res : Response ) => {
167167 try {
168- const config = getConfig ( ) ;
169168 const { token } = req . body ;
170169
171170 if ( ! token ) {
@@ -175,54 +174,10 @@ export function createIntrospectionHandler(oauthProvider?: any) {
175174 } ) ;
176175 }
177176
178- if ( config . AUTH_MODE === "full" ) {
179- // Proxy introspection to external OAuth provider
180- try {
181- const introspectionParams = new URLSearchParams ( {
182- token,
183- token_type_hint : "access_token"
184- } ) ;
185-
186- const introspectionResponse = await fetch ( `${ config . OAUTH_ISSUER } /oauth/introspect` , {
187- method : "POST" ,
188- headers : {
189- "Content-Type" : "application/x-www-form-urlencoded" ,
190- "Authorization" : `Basic ${ Buffer . from ( `${ config . OAUTH_CLIENT_ID } :${ config . OAUTH_CLIENT_SECRET } ` ) . toString ( 'base64' ) } `
191- } ,
192- body : introspectionParams
193- } ) ;
194-
195- if ( ! introspectionResponse . ok ) {
196- logger . warn ( "External OAuth introspection failed" , {
197- status : introspectionResponse . status
198- } ) ;
199- return res . json ( { active : false } ) ;
200- }
201-
202- const introspectionData = await introspectionResponse . json ( ) ;
203-
204- logger . info ( "Token introspection proxied to external provider" , {
205- token : token . substring ( 0 , 10 ) + "..." ,
206- active : introspectionData . active
207- } ) ;
208-
209- res . json ( introspectionData ) ;
210- } catch ( error ) {
211- logger . warn ( "External OAuth introspection error" , {
212- error : error instanceof Error ? error . message : error
213- } ) ;
214- res . json ( { active : false } ) ;
215- }
216- } else {
217- // Fallback - use our own token validator
218- logger . info ( "Token introspection requested" , { token : token . substring ( 0 , 10 ) + "..." } ) ;
219- res . json ( {
220- active : true ,
221- scope : "read" ,
222- client_id : "mcp-client" ,
223- exp : Math . floor ( Date . now ( ) / 1000 ) + 3600
224- } ) ;
225- }
177+ logger . info ( "Token introspection requested" , { token : token . substring ( 0 , 10 ) + "..." } ) ;
178+
179+ // Return inactive for OAuth proxy pattern - external IdP handles actual validation
180+ res . json ( { active : false } ) ;
226181
227182 } catch ( error ) {
228183 logger . error ( "Token introspection error" , {
0 commit comments