Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting_started.rst: add JSONOAuthLibCore as part of tutorial #734

Merged
merged 1 commit into from Aug 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/rest-framework/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ Also add the following to your `settings.py` module:
.. code-block:: python

OAUTH2_PROVIDER = {
# parses OAuth2 data from application/json requests
'OAUTH2_BACKEND_CLASS': 'oauth2_provider.oauth2_backends.JSONOAuthLibCore',
# this is the list of available scopes
'SCOPES': {'read': 'Read scope', 'write': 'Write scope', 'groups': 'Access to your groups'}
}
Expand All @@ -112,6 +114,10 @@ Also add the following to your `settings.py` module:
)
}

`OAUTH2_PROVIDER` setting parameter sets the backend class that is used to parse OAuth2 requests.
The `JSONOAuthLibCore` class extends the default OAuthLibCore to parse correctly
`application/json` requests.

`OAUTH2_PROVIDER.SCOPES` setting parameter contains the scopes that the application will be aware of,
so we can use them for permission check.

Expand Down