Fix typo in RFC 9728 impl (#5126)

This commit is contained in:
Tommaso Sciortino
2025-07-29 16:03:39 -07:00
committed by GitHub
parent 32c7070d7f
commit ed2b4c6aa4
3 changed files with 3 additions and 17 deletions

View File

@@ -140,7 +140,7 @@ describe('OAuthUtils', () => {
describe('parseWWWAuthenticateHeader', () => {
it('should parse resource metadata URI from WWW-Authenticate header', () => {
const header =
'Bearer realm="example", resource_metadata_uri="https://example.com/.well-known/oauth-protected-resource"';
'Bearer realm="example", resource_metadata="https://example.com/.well-known/oauth-protected-resource"';
const result = OAuthUtils.parseWWWAuthenticateHeader(header);
expect(result).toBe(
'https://example.com/.well-known/oauth-protected-resource',

View File

@@ -198,8 +198,8 @@ export class OAuthUtils {
* @returns The resource metadata URI if found
*/
static parseWWWAuthenticateHeader(header: string): string | null {
// Parse Bearer realm and resource_metadata_uri
const match = header.match(/resource_metadata_uri="([^"]+)"/);
// Parse Bearer realm and resource_metadata
const match = header.match(/resource_metadata="([^"]+)"/);
if (match) {
return match[1];
}