IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Make Scope property on AuthorizeResponse settable

Open user1336 opened this issue 6 years ago • 8 comments

In the OAuth2 authorization_code flow (no OIDC) the Scope property is always included in the AuthorizeResponse. We would like to exclude it on this response so we can create the following response: HTTP/1.1 302 Found Location: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA&state=xyz (without including the granted scopes). This would conform the following section: http://tools.ietf.org/html/rfc6749#section-4.1.2

It's readonly and defaults to: Request?.ValidatedScopes?.GrantedResources?.ToScopeNames()?.ToSpaceSeparatedString();

Would it be possible to create a (private) set so we can override it and construct a response on the Authorize endpoint? We could probably change this in de override of the CreateCodeAsync in the AuthorizeResponseGenerator.

user1336 avatar Feb 05 '20 07:02 user1336

why?

leastprivilege avatar Feb 05 '20 08:02 leastprivilege

Data minimization, the (external) client breaks because there is more information in the response. I realize that they don't comply the spec (don't ask..). On the other hand, I think it would be nice to construct a response that matches the spec exactly without additional parameters.

I can probably do a PR if you're open to it.

user1336 avatar Feb 05 '20 10:02 user1336

We need to discuss this first.

leastprivilege avatar Feb 05 '20 14:02 leastprivilege

Sure -- keep me posted about the progress.

user1336 avatar Feb 05 '20 16:02 user1336

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.

stale[bot] avatar Feb 19 '20 16:02 stale[bot]

Have you got a chance to look at this? Is there anything I can do to help?

user1336 avatar Mar 09 '20 08:03 user1336

Sorry, we don't plan on doing this. Sorry.

brockallen avatar Sep 07 '20 15:09 brockallen

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 26 '20 18:11 github-actions[bot]