Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
test_oauth2_django
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
test-it
test_oauth2_django
Commits
b0bb087b
Commit
b0bb087b
authored
Nov 02, 2019
by
Tross Yvormes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add TEST_OAUTH_SCOPES setting
parent
b8a0d7e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
README.md
README.md
+2
-0
test_oauth/views.py
test_oauth/views.py
+1
-1
No files found.
README.md
View file @
b0bb087b
...
...
@@ -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
...
...
test_oauth/views.py
View file @
b0bb087b
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment