@@ -320,6 +320,7 @@ describe("OAuth Authorization", () => {
320
320
321
321
it ( "generates authorization URL with PKCE challenge" , async ( ) => {
322
322
const { authorizationUrl, codeVerifier } = await startAuthorization (
323
+ "https://resource.example.com" ,
323
324
"https://auth.example.com" ,
324
325
{
325
326
clientInformation : validClientInfo ,
@@ -338,11 +339,13 @@ describe("OAuth Authorization", () => {
338
339
expect ( authorizationUrl . searchParams . get ( "redirect_uri" ) ) . toBe (
339
340
"http://localhost:3000/callback"
340
341
) ;
342
+ expect ( authorizationUrl . searchParams . get ( "resource" ) ) . toBe ( "https://resource.example.com" ) ;
341
343
expect ( codeVerifier ) . toBe ( "test_verifier" ) ;
342
344
} ) ;
343
345
344
346
it ( "uses metadata authorization_endpoint when provided" , async ( ) => {
345
347
const { authorizationUrl } = await startAuthorization (
348
+ "https://resource.example.com" ,
346
349
"https://auth.example.com" ,
347
350
{
348
351
metadata : validMetadata ,
@@ -363,7 +366,7 @@ describe("OAuth Authorization", () => {
363
366
} ;
364
367
365
368
await expect (
366
- startAuthorization ( "https://auth .example.com" , {
369
+ startAuthorization ( "https://resource .example.com" , "https://auth.example.com" , {
367
370
metadata,
368
371
clientInformation : validClientInfo ,
369
372
redirectUrl : "http://localhost:3000/callback" ,
@@ -379,7 +382,7 @@ describe("OAuth Authorization", () => {
379
382
} ;
380
383
381
384
await expect (
382
- startAuthorization ( "https://auth.example.com" , {
385
+ startAuthorization ( "https://resource.example.com" , "https:// auth.example.com", {
383
386
metadata,
384
387
clientInformation : validClientInfo ,
385
388
redirectUrl : "http://localhost:3000/callback" ,
0 commit comments