-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "state" parameter of error responses #1298
Conversation
Please can you provide some information about why you want to add this change? Thank you |
I added description I hope it is clear enough. |
Just merged |
Thanks for this @hafezdivandari - the code looks good. I was wondering if you would be up for adding some tests to ensure we don't add any regressions for this in future. Because I've taken so long to get around to this, if you don't have time I will try to add them in myself and we can then get this merged. If it is also possible to add a changelog entry that would be appreciated but I can do this myself if you don't have time. Thanks so much for this! |
@Sephster just added some tests and a changelog entry. |
Thanks for this @hafezdivandari - looks great |
This PR was squashed before being merged into the 0.9-dev branch. Discussion ---------- Fix Ci - Fix CS - Fix failing tests related to thephpleague/oauth2-server#1298 Commits ------- 9dfd8cc Fix tests 568c7de Fix CS
According to RFC 6749 on error response of the implicit grant, the authorization server should add parameters to the fragment component of the redirection URI and the
state
parameter is required if it was present on the request.There already 2 error responses that have redirect URI:
Invalid_scope
:state
parameter when redirecting. This PR fixes this on both 'auth code' and 'implicit' grants.http://example.com/callback?error=access_denied&error_description=...
http://example.com/callback?state=123&error=access_denied&error_description=...
http://example.com/callback#error=access_denied&error_description=...
http://example.com/callback#state=123&error=access_denied&error_description=...
access_denied
: This error response does include thestate
parameter when redirecting as expected, but when using implicit grant, the error'sstate
parameter is on query string and other parameters were on fragment component. This PR fixes this.http://example.com/callback?state=123#error=access_denied&error_description=...
http://example.com/callback#state=123&error=access_denied&error_description=...