Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f6d9c9a3
Commit
f6d9c9a3
authored
May 26, 2016
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added scopes claim to JWT access tokens (#12571)
This will allow API servers to limit access based on scopes.
parent
a9a3fabf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletions
+5
-1
lms/djangoapps/oauth_dispatch/tests/mixins.py
+1
-0
lms/djangoapps/oauth_dispatch/tests/test_client_credentials.py
+3
-1
lms/djangoapps/oauth_dispatch/views.py
+1
-0
No files found.
lms/djangoapps/oauth_dispatch/tests/mixins.py
View file @
f6d9c9a3
...
...
@@ -34,6 +34,7 @@ class AccessTokenMixin(object):
'aud'
:
audience
,
'iss'
:
issuer
,
'preferred_username'
:
user
.
username
,
'scopes'
:
scopes
,
}
if
'email'
in
scopes
:
...
...
lms/djangoapps/oauth_dispatch/tests/test_client_credentials.py
View file @
f6d9c9a3
""" Tests for OAuth 2.0 client credentials support. """
from
__future__
import
unicode_literals
import
json
from
django.core.urlresolvers
import
reverse
...
...
@@ -52,7 +54,7 @@ class ClientCredentialsTest(mixins.AccessTokenMixin, TestCase):
redirect_uri
=
DUMMY_REDIRECT_URL
,
client_id
=
'dot-app-client-id'
,
)
scopes
=
(
'read'
,
'write'
,
'email'
)
scopes
=
[
'read'
,
'write'
,
'email'
]
data
=
{
'grant_type'
:
'client_credentials'
,
'client_id'
:
application
.
client_id
,
...
...
lms/djangoapps/oauth_dispatch/views.py
View file @
f6d9c9a3
...
...
@@ -130,6 +130,7 @@ class AccessTokenView(_DispatchingView):
'exp'
:
now
+
expires_in
,
'iat'
:
now
,
'preferred_username'
:
user
.
username
,
'scopes'
:
scopes
,
}
for
scope
in
scopes
:
...
...
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