Skip to content

Commit

Permalink
Added scope override to OAuth flows. (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
azaslonov authored Jun 22, 2020
1 parent 40449f8 commit 970b1b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/models/authorizationServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 970b1b8

Please sign in to comment.