11Settings
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
67swappable models. See issue #90 (https://github.com/evonove/django-oauth-toolkit/issues/90) for details.
78
89For example:
@@ -32,6 +33,12 @@ The number of seconds an access token remains valid. Requesting a protected
3233resource after this duration will fail. Keep this value high enough so clients
3334can 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+
3542ALLOWED_REDIRECT_URI_SCHEMES
3643~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3744
@@ -67,6 +74,12 @@ CLIENT_SECRET_GENERATOR_LENGTH
6774The length of the generated secrets, in characters. If this value is too low,
6875secrets 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+
7083OAUTH2_SERVER_CLASS
7184~~~~~~~~~~~~~~~~~~~
7285The import string for the ``server_class `` (or ``oauthlib.oauth2.Server `` subclass)
@@ -87,6 +100,12 @@ REFRESH_TOKEN_EXPIRE_SECONDS
87100The number of seconds before a refresh token gets removed from the database by
88101the ``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+
90109ROTATE_REFRESH_TOKEN
91110~~~~~~~~~~~~~~~~~~~~
92111When is set to `True ` (default) a new refresh token is issued to the client when the client refreshes an access token.
0 commit comments