-
Notifications
You must be signed in to change notification settings - Fork 368
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
Add scope parameter to the refreshToken request. #225
Conversation
Some providers require a scope when requesting a token refresh. Uses the same process as requestResourceOwnerToken() due to the RFC requiring the scope to be the same for an access_token request and for a refresh token request
We required the same fix while using Windows Active Directory. The addition of scope worked perfectly. |
RFC 6749 claims the scope parameter to be optional when refreshing a token. This seems to be a bug in the provider’s OAuth implementation and should reported to them. Sending scopes to the token endpoint when refreshing token opens the possibility to request an access token with narrower scope than the original authorization grant allows:
|
While I agree, getting Microsoft to change their default ADFS behavior will be tricky ;) |
Anyway, this is a nice-to-have feature (independent of allowing to work around Microsoft’s weird implementation). |
I forked this library and added this functionality. I plan to make other changes to the OpenID Connect Library. I made it configurable with sending it by default, so if a provider has problems with scopes in such request, you are able to disable it. The only problem I see with this is: If the refresh token was obtained by the authorization code grant with set |
Some providers require an optional scope when requesting a refresh of a token. If not provided they will return an invalid_request error.
Scope for the refresh token should be the same scope as the access token, so using the same method should be sufficient.
List of common tasks a pull request require complete