@@ -9,25 +9,23 @@ export class AuthBasicMetadataVar1Scenario implements Scenario {
99 name = 'auth/basic-metadata-var1' ;
1010 description =
1111 'Tests Basic OAuth flow with DCR, PRM at root location, OAuth metadata at OpenID discovery path, and no scopes required' ;
12- private authServer = new ServerLifecycle ( ( ) => this . authBaseUrl ) ;
13- private server = new ServerLifecycle ( ( ) => this . baseUrl ) ;
12+ private authServer = new ServerLifecycle ( ) ;
13+ private server = new ServerLifecycle ( ) ;
1414 private checks : ConformanceCheck [ ] = [ ] ;
15- private baseUrl : string = '' ;
16- private authBaseUrl : string = '' ;
1715
1816 async start ( ) : Promise < ScenarioUrls > {
1917 this . checks = [ ] ;
2018
21- const authApp = createAuthServer ( this . checks , ( ) => this . authBaseUrl , {
19+ const authApp = createAuthServer ( this . checks , this . authServer . getUrl , {
2220 metadataPath : '/.well-known/openid-configuration' ,
2321 isOpenIdConfiguration : true
2422 } ) ;
25- this . authBaseUrl = await this . authServer . start ( authApp ) ;
23+ await this . authServer . start ( authApp ) ;
2624
2725 const app = createServer (
2826 this . checks ,
29- ( ) => this . baseUrl ,
30- ( ) => this . authBaseUrl ,
27+ this . server . getUrl ,
28+ this . authServer . getUrl ,
3129 {
3230 // TODO: this will put this path in the WWW-Authenticate header
3331 // but RFC 9728 states that in that case, the resource in the PRM
@@ -38,9 +36,9 @@ export class AuthBasicMetadataVar1Scenario implements Scenario {
3836 prmPath : '/.well-known/oauth-protected-resource'
3937 }
4038 ) ;
41- this . baseUrl = await this . server . start ( app ) ;
39+ await this . server . start ( app ) ;
4240
43- return { serverUrl : `${ this . baseUrl } /mcp` } ;
41+ return { serverUrl : `${ this . server . getUrl ( ) } /mcp` } ;
4442 }
4543
4644 async stop ( ) {
0 commit comments