hiidef / oauth2app

Django OAuth 2.0 Server App. Please fork and improve!
https://github.com/hiidef/oauth2app
MIT License
271 stars 115 forks source link

Added check_scope keyword to disable checking scope against existing AccessRange objects #32

Closed mk-fg closed 11 months ago

mk-fg commented 12 years ago

Related to the same use-case as #31.

Currently, Authorizer.validate requires all AccessRange objects to exist in db, even though it doesn't actually use them anywhere, which creates a problem in the following scenario:

There are workarounds for this, including temporary creating "private:rw" AccessRange, redirect to change GET parameters or just ignore InvalidScope error, neither of which seem to be particulary good and supported.

I'm also unsure if updating Authorizer.scope is the supported way to return reduced access_ranges. If not, I propose adding a "scope" parameter to Authorizer.grant_redirect method, to facilitate such use-case (partial authorization).