fix: use authorization_server_url as issuer when fetching metadata (#763)
This commit is contained in:
parent
4b2ad0385d
commit
f3584f2a41
2 changed files with 4 additions and 4 deletions
|
|
@ -1778,7 +1778,7 @@ describe("OAuth Authorization", () => {
|
|||
status: 200,
|
||||
json: async () => ({
|
||||
resource: "https://my.resource.com/",
|
||||
authorization_servers: ["https://auth.example.com/"],
|
||||
authorization_servers: ["https://auth.example.com/oauth"],
|
||||
}),
|
||||
});
|
||||
} else if (urlString === "https://auth.example.com/.well-known/oauth-authorization-server/path/name") {
|
||||
|
|
@ -1821,8 +1821,8 @@ describe("OAuth Authorization", () => {
|
|||
// First call should be to PRM
|
||||
expect(calls[0][0].toString()).toBe("https://my.resource.com/.well-known/oauth-protected-resource/path/name");
|
||||
|
||||
// Second call should be to AS metadata with the path from serverUrl
|
||||
expect(calls[1][0].toString()).toBe("https://auth.example.com/.well-known/oauth-authorization-server/path/name");
|
||||
// Second call should be to AS metadata with the path from authorization server
|
||||
expect(calls[1][0].toString()).toBe("https://auth.example.com/.well-known/oauth-authorization-server/oauth");
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -606,7 +606,7 @@ export async function discoverOAuthMetadata(
|
|||
protocolVersion ??= LATEST_PROTOCOL_VERSION;
|
||||
|
||||
const response = await discoverMetadataWithFallback(
|
||||
issuer,
|
||||
authorizationServerUrl,
|
||||
'oauth-authorization-server',
|
||||
{
|
||||
protocolVersion,
|
||||
|
|
|
|||
Loading…
Reference in a new issue