@@ -105,6 +105,7 @@ export class McpOAuthClientProvider implements OAuthClientProvider {
105105 private readonly _state : string ,
106106 private readonly _authServerMeta : Record < string , any > | null ,
107107 private readonly _resourceIndicator : string | null ,
108+ private readonly _resourceDisabled : boolean ,
108109 private readonly _clientName : string ,
109110 private readonly _configuredRedirectUri ?: string ,
110111 private readonly _configuredClientId ?: string ,
@@ -175,6 +176,7 @@ export class McpOAuthClientProvider implements OAuthClientProvider {
175176 state ,
176177 authServerMeta ,
177178 resourceIndicator ,
179+ options ?. resource === false ,
178180 serverName || "Roo Code" ,
179181 options ?. redirectUri ,
180182 options ?. clientId ,
@@ -389,11 +391,11 @@ export class McpOAuthClientProvider implements OAuthClientProvider {
389391 // 1. Replace the origin+pathname with the real authorization_endpoint.
390392 // 2. Preserve all SDK-generated query params (client_id, code_challenge, etc.)
391393 // 3. Add `scope` when the server advertises scopes but the SDK omitted it.
392- // 4. Add RFC 8707 `resource` parameter when the protected resource metadata
393- // advertised a resource indicator .
394+ // 4. Set an explicit or discovered RFC 8707 `resource` parameter. Preserve
395+ // an SDK-generated value unless the configuration disables it .
394396 if ( this . _resourceIndicator ) {
395397 authorizationUrl . searchParams . set ( "resource" , this . _resourceIndicator )
396- } else {
398+ } else if ( this . _resourceDisabled ) {
397399 authorizationUrl . searchParams . delete ( "resource" )
398400 }
399401 let correctedUrl = authorizationUrl
0 commit comments