Skip to content

Commit 566fe67

Browse files
Aristobulo Menesesjleclanche
authored andcommitted
Document new swappable models
1 parent 5c30b93 commit 566fe67

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

docs/settings.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
Settings
22
========
33

4-
Our configurations are all namespaced under the `OAUTH2_PROVIDER` settings with the solely exception of
5-
`OAUTH2_PROVIDER_APPLICATION_MODEL`: this is because of the way Django currently implements
4+
Our configurations are all namespaced under the `OAUTH2_PROVIDER` settings with the exception of
5+
`OAUTH2_PROVIDER_APPLICATION_MODEL, OAUTH2_PROVIDER_ACCESS_TOKEN_MODEL, OAUTH2_PROVIDER_GRANT_MODEL,
6+
OAUTH2_PROVIDER_REFRESH_TOKEN_MODEL`: this is because of the way Django currently implements
67
swappable models. See issue #90 (https://github.com/evonove/django-oauth-toolkit/issues/90) for details.
78

89
For example:
@@ -32,6 +33,12 @@ The number of seconds an access token remains valid. Requesting a protected
3233
resource after this duration will fail. Keep this value high enough so clients
3334
can cache the token for a reasonable amount of time.
3435

36+
ACCESS_TOKEN_MODEL
37+
~~~~~~~~~~~~~~~~~
38+
The import string of the class (model) representing your access tokens. Overwrite
39+
this value if you wrote your own implementation (subclass of
40+
``oauth2_provider.models.AccessToken``).
41+
3542
ALLOWED_REDIRECT_URI_SCHEMES
3643
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3744

@@ -67,6 +74,12 @@ CLIENT_SECRET_GENERATOR_LENGTH
6774
The length of the generated secrets, in characters. If this value is too low,
6875
secrets may become subject to bruteforce guessing.
6976

77+
GRANT_MODEL
78+
~~~~~~~~~~~~~~~~~
79+
The import string of the class (model) representing your grants. Overwrite
80+
this value if you wrote your own implementation (subclass of
81+
``oauth2_provider.models.Grant``).
82+
7083
OAUTH2_SERVER_CLASS
7184
~~~~~~~~~~~~~~~~~~~
7285
The import string for the ``server_class`` (or ``oauthlib.oauth2.Server`` subclass)
@@ -87,6 +100,12 @@ REFRESH_TOKEN_EXPIRE_SECONDS
87100
The number of seconds before a refresh token gets removed from the database by
88101
the ``cleartokens`` management command. Check :ref:`cleartokens` management command for further info.
89102

103+
REFRESH_TOKEN_MODEL
104+
~~~~~~~~~~~~~~~~~
105+
The import string of the class (model) representing your refresh tokens. Overwrite
106+
this value if you wrote your own implementation (subclass of
107+
``oauth2_provider.models.RefreshToken``).
108+
90109
ROTATE_REFRESH_TOKEN
91110
~~~~~~~~~~~~~~~~~~~~
92111
When is set to `True` (default) a new refresh token is issued to the client when the client refreshes an access token.

0 commit comments

Comments
 (0)