Skip to content
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 "Scopes must be set on post auth" #320

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ibrewster
Copy link

Fixes the "Scopes must be set on post auth" error when trying to request the authorization endpoint without specifying the "scope" parameter, as allowed in the OAuth RFC.

ibrewster and others added 6 commits March 16, 2017 11:24
According to the OAuth RFC, the Authorization Code grant can be requested without explicitly providing a list of scopes. This change enables that behavior by using the default scopes the OAuth request was initially populated with.
Fix "Scopes must be set on post auth." exception
Use the locally defined scopes variable rather than trying to pull from the request object, which may not exist in certain requests.
Check to make sure scopes is defined locally or request exists in kwargs and has a scopes attribute. If not, fall back to the old behavior of not declaring default scopes and hope they are not needed.
Remove unused line that wasn't being covered by tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant