Skip to content

Commit 194e5eb

Browse files
committed
Add configurable SCOPE setting.
1 parent 6f57070 commit 194e5eb

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Step 6: Set up all the correct options (see below for available options)
6262
* OAUTHADMIN_PING_INTERVAL (optional, defaults to 300): Minimum number of seconds between ping requests
6363
* OAUTHADMIN_PING: (optional, defaults to None) This optional function takes an oauth token and returns True if it's still valid and False if it's no longer valid (if they have logged out of the oauth server)
6464
* OAUTHADMIN_DEFAULT_NEXT_URL: (optional, defaults to /admin). This optional value is the default page that a successful oauth login process will land you on.
65+
* OAUTHADMIN_SCOPE: (optional, defaults to ['default']). This is a list of authorization scopes.
6566

6667
## Testing
6768

oauthadmin/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"GET_USER": 'oauthadmin.stubs.get_user',
66
"PING_INTERVAL": 300,
77
"OAUTHADMIN_DEFAULT_NEXT_URL": "/admin/",
8+
"SCOPE": ['default'],
89
}
910

1011
global_prefix = 'OAUTHADMIN_'

oauthadmin/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def login(request):
5454
oauth = OAuth2Session(
5555
client_id=app_setting('CLIENT_ID'),
5656
redirect_uri=redirect_uri,
57-
scope=["default"],
57+
scope=app_setting('SCOPE'),
5858
state=state,
5959
)
6060
authorization_url, state = oauth.authorization_url(app_setting('AUTH_URL'))

0 commit comments

Comments
 (0)