@@ -320,6 +320,7 @@ describe("OAuth Authorization", () => {
320320
321321 it ( "generates authorization URL with PKCE challenge" , async ( ) => {
322322 const { authorizationUrl, codeVerifier } = await startAuthorization (
323+ "https://resource.example.com" ,
323324 "https://auth.example.com" ,
324325 {
325326 clientInformation : validClientInfo ,
@@ -338,11 +339,13 @@ describe("OAuth Authorization", () => {
338339 expect ( authorizationUrl . searchParams . get ( "redirect_uri" ) ) . toBe (
339340 "http://localhost:3000/callback"
340341 ) ;
342+ expect ( authorizationUrl . searchParams . get ( "resource" ) ) . toBe ( "https://resource.example.com" ) ;
341343 expect ( codeVerifier ) . toBe ( "test_verifier" ) ;
342344 } ) ;
343345
344346 it ( "uses metadata authorization_endpoint when provided" , async ( ) => {
345347 const { authorizationUrl } = await startAuthorization (
348+ "https://resource.example.com" ,
346349 "https://auth.example.com" ,
347350 {
348351 metadata : validMetadata ,
@@ -363,7 +366,7 @@ describe("OAuth Authorization", () => {
363366 } ;
364367
365368 await expect (
366- startAuthorization ( "https://auth .example.com" , {
369+ startAuthorization ( "https://resource .example.com" , "https://auth.example.com" , {
367370 metadata,
368371 clientInformation : validClientInfo ,
369372 redirectUrl : "http://localhost:3000/callback" ,
@@ -379,7 +382,7 @@ describe("OAuth Authorization", () => {
379382 } ;
380383
381384 await expect (
382- startAuthorization ( "https://auth.example.com" , {
385+ startAuthorization ( "https://resource.example.com" , "https:// auth.example.com", {
383386 metadata,
384387 clientInformation : validClientInfo ,
385388 redirectUrl : "http://localhost:3000/callback" ,
0 commit comments