Commit b0bb087b authored by Tross Yvormes's avatar Tross Yvormes

Add TEST_OAUTH_SCOPES setting

parent b8a0d7e9
...@@ -39,6 +39,8 @@ Some other options are more interesting: ...@@ -39,6 +39,8 @@ Some other options are more interesting:
* `TEST_OAUTH_RESPECT_ID` (default False): If True, use the TEST Auth ID of a * `TEST_OAUTH_RESPECT_ID` (default False): If True, use the TEST Auth ID of a
user as the identifying column in the Django app, otherwise use the user as the identifying column in the Django app, otherwise use the
username. username.
* `TEST_OAUTH_SCOPES` (default `['read_profile']`): Scope of the OAuth
requests.
### Verifiers ### Verifiers
......
...@@ -9,7 +9,7 @@ from test_oauth.session import TESTOAuth2Session ...@@ -9,7 +9,7 @@ from test_oauth.session import TESTOAuth2Session
@never_cache @never_cache
def login(request, next=None): def login(request, next=None):
authorization_url, request.session['oauth_state'] = TESTOAuth2Session( authorization_url, request.session['oauth_state'] = TESTOAuth2Session(
scope=['read_profile'], scope=getattr(settings, 'TEST_OAUTH_SCOPES', ['read_profile']),
).authorization_url() ).authorization_url()
return redirect(authorization_url) return redirect(authorization_url)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment