Skip to content

Commit 7b02c5c

Browse files
authored
Retain URL search parameter
1 parent c5fcba4 commit 7b02c5c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/client/auth.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ export async function discoverOAuthProtectedResourceMetadata(
263263
} else {
264264
const issuer = new URL(serverUrl);
265265
const wellKnownPath = buildWellKnownPath('oauth-protected-resource', issuer.pathname);
266+
wellKnownPath.search = issuer.search;
266267
url = new URL(wellKnownPath, issuer);
267268
}
268269

@@ -365,6 +366,7 @@ export async function discoverOAuthMetadata(
365366
// Try path-aware discovery first (RFC 8414 compliant)
366367
const wellKnownPath = buildWellKnownPath('oauth-authorization-server', issuer.pathname);
367368
const pathAwareUrl = new URL(wellKnownPath, issuer);
369+
pathAwareUrl.search = issuer.search;
368370
let response = await tryMetadataDiscovery(pathAwareUrl, protocolVersion);
369371

370372
// If path-aware discovery fails with 404, try fallback to root discovery

0 commit comments

Comments
 (0)