Skip to content

Commit

Permalink
fix: base accepted scope off the accepted scopes, not param scopes
Browse files Browse the repository at this point in the history
The end result here is the same for all flows going through the default
interaction checks, but the moment you start disabling checks and omit
to call acceptedScopesFor, this makes more sense
  • Loading branch information
panva committed Jun 2, 2019
1 parent cc66876 commit ccec5d3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/helpers/oidc_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,10 @@ module.exports = function getContext(provider) {
}

acceptedScope() {
const scopes = new Set([...this.requestParamScopes]);
const rejected = this.session.rejectedScopesFor(this.params.client_id);
rejected.forEach(Set.prototype.delete.bind(scopes));
// acceptedScopesFor already has the rejected filtered out
const accepted = this.session.acceptedScopesFor(this.params.client_id);

return [...scopes].join(' ') || undefined;
return [...this.requestParamScopes].filter(scope => accepted.has(scope)).join(' ') || undefined;
}

resolvedClaims() {
Expand Down

0 comments on commit ccec5d3

Please sign in to comment.