From b0bb087b21bf7ed8e934f14d8efcbf56c6a2e91a Mon Sep 17 00:00:00 2001 From: Tross Yvormes Date: Sat, 2 Nov 2019 01:53:01 -0400 Subject: [PATCH] Add TEST_OAUTH_SCOPES setting --- README.md | 2 ++ test_oauth/views.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cce4b3..1c26c80 100644 --- a/README.md +++ b/README.md @@ -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 user as the identifying column in the Django app, otherwise use the username. + * `TEST_OAUTH_SCOPES` (default `['read_profile']`): Scope of the OAuth + requests. ### Verifiers diff --git a/test_oauth/views.py b/test_oauth/views.py index d8540e2..adefb19 100644 --- a/test_oauth/views.py +++ b/test_oauth/views.py @@ -9,7 +9,7 @@ from test_oauth.session import TESTOAuth2Session @never_cache def login(request, next=None): authorization_url, request.session['oauth_state'] = TESTOAuth2Session( - scope=['read_profile'], + scope=getattr(settings, 'TEST_OAUTH_SCOPES', ['read_profile']), ).authorization_url() return redirect(authorization_url) -- GitLab