providers/oauth2: add authorized scopes to AUTHORIZE_APPLICATION event

This commit is contained in:
Jens Langhammer 2021-02-08 11:51:38 +01:00
parent f8abe3e210
commit fe4b2d1a34
2 changed files with 6 additions and 4 deletions

View file

@ -253,6 +253,7 @@ class OAuthFulfillmentStage(StageView):
EventAction.AUTHORIZE_APPLICATION,
authorized_application=application,
flow=self.executor.plan.flow_pk,
scopes=", ".join(self.params.scope),
).from_http(self.request)
return redirect(self.create_response_uri())
except (ClientIdError, RedirectUriError) as error:

View file

@ -65,13 +65,13 @@ export class EventInfo extends LitElement {
case "model_updated":
case "model_deleted":
return html`
<h3>${gettext("Affected model:")}</h3><hr>
<h3>${gettext("Affected model:")}</h3>
${this.getModelInfo(this.event.context.model as EventContext)}
`;
case "authorize_application":
return html`<div class="pf-l-flex">
<div class="pf-l-flex__item">
<h3>${gettext("Authorized application:")}</h3><hr>
<h3>${gettext("Authorized application:")}</h3>
${this.getModelInfo(this.event.context.authorized_application as EventContext)}
</div>
<div class="pf-l-flex__item">
@ -83,14 +83,15 @@ export class EventInfo extends LitElement {
}), html`<ak-spinner size=${SpinnerSize.Medium}></ak-spinner>`)}
</span>
</div>
</div>`;
</div>
<ak-expand>${this.defaultResponse()}</ak-expand>`;
case "login_failed":
return html`
<h3>${gettext(`Attempted to log in as ${this.event.context.username}`)}</h3>
<ak-expand>${this.defaultResponse()}</ak-expand>`;
case "token_view":
return html`
<h3>${gettext("Token:")}</h3><hr>
<h3>${gettext("Token:")}</h3>
${this.getModelInfo(this.event.context.token as EventContext)}`;
case "property_mapping_exception":
return html`<div class="pf-l-flex">