@@ -232,14 +232,16 @@ export class OAuth2ProviderManager {
232232 client : OAuth2ClientWithConfig
233233 ) : Promise < void > {
234234 try {
235- // Try to fetch OIDC issuer endpoint to verify provider is reachable
236- const endpoint = client . OIDCConfig ?. issuer
237- if ( ! endpoint ) {
238- throw new Error ( 'No issuer endpoint configured' )
235+ // Try to fetch OIDC well-known endpoint to verify provider is reachable
236+ const wellKnownUrl = client . wellKnownUri
237+ if ( ! wellKnownUrl ) {
238+ throw new Error ( 'No well-known URL configured' )
239239 }
240240
241- // Use HEAD request for efficiency
242- const response = await fetch ( endpoint , {
241+ console . log ( ` Checking ${ providerName } at: ${ wellKnownUrl } ` )
242+
243+ // Use HEAD request as per HTTP standards - all endpoints supporting GET should support HEAD
244+ const response = await fetch ( wellKnownUrl , {
243245 method : 'HEAD' ,
244246 signal : AbortSignal . timeout ( 5000 ) // 5 second timeout
245247 } )
@@ -252,7 +254,7 @@ export class OAuth2ProviderManager {
252254 error : isAvailable ? undefined : `HTTP ${ response . status } `
253255 } )
254256
255- console . log ( ` ${ providerName } : ${ isAvailable ? '✓ healthy' : '✗ unhealthy' } ` )
257+ console . log ( ` ${ providerName } : ${ isAvailable ? 'healthy' : 'unhealthy' } ` )
256258 } catch ( error ) {
257259 const errorMessage = error instanceof Error ? error . message : 'Unknown error'
258260 this . providerStatus . set ( providerName , {
@@ -261,7 +263,7 @@ export class OAuth2ProviderManager {
261263 lastChecked : new Date ( ) ,
262264 error : errorMessage
263265 } )
264- console . log ( ` ${ providerName } : ✗ unhealthy (${ errorMessage } )` )
266+ console . log ( ` ${ providerName } : unhealthy (${ errorMessage } )` )
265267 }
266268 }
267269
0 commit comments