diff --git a/src/components/operations/operation-details/ko/runtime/operation-console.ts b/src/components/operations/operation-details/ko/runtime/operation-console.ts index 7451130b0..ced8fb37f 100644 --- a/src/components/operations/operation-details/ko/runtime/operation-console.ts +++ b/src/components/operations/operation-details/ko/runtime/operation-console.ts @@ -515,7 +515,14 @@ export class OperationConsole { return; } + const api = this.api(); const authorizationServer = this.authorizationServer(); + const scopeOverride = api.authenticationSettings?.oAuth2?.scope; + + if (scopeOverride) { + authorizationServer.scopes = [scopeOverride]; + } + const accessToken = await this.oauthService.authenticate(grantType, authorizationServer); this.setAuthorizationHeader(accessToken); diff --git a/src/models/authorizationServer.ts b/src/models/authorizationServer.ts index 8286b28f7..25db60398 100644 --- a/src/models/authorizationServer.ts +++ b/src/models/authorizationServer.ts @@ -8,7 +8,7 @@ export class AuthorizationServer { public readonly authorizationEndpoint: string; public readonly tokenEndpoint: string; public readonly grantTypes: string[]; - public readonly scopes: string[]; + public scopes: string[]; constructor(contract: AuthorizationServerContract) {