Change "DOP" with "OIDC" in settings.
This commit is contained in:
parent
9bcdc0e37a
commit
94ccfc54cf
5 changed files with 10 additions and 9 deletions
|
@ -98,7 +98,7 @@ class AuthorizeEndpoint(object):
|
|||
code.client = self.client
|
||||
code.code = uuid.uuid4().hex
|
||||
code.expires_at = timezone.now() + timedelta(
|
||||
seconds=settings.get('DOP_CODE_EXPIRE'))
|
||||
seconds=settings.get('OIDC_CODE_EXPIRE'))
|
||||
code.scope = self.params.scope
|
||||
code.save()
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class TokenEndpoint(object):
|
|||
dic = {
|
||||
'access_token': token.access_token,
|
||||
'token_type': 'bearer',
|
||||
'expires_in': settings.get('DOP_TOKEN_EXPIRE'),
|
||||
'expires_in': settings.get('OIDC_TOKEN_EXPIRE'),
|
||||
'id_token': id_token,
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ class UserInfoEndpoint(object):
|
|||
|
||||
dic.update(standard_claims.create_response_dic())
|
||||
|
||||
extra_claims = settings.get('DOP_EXTRA_SCOPE_CLAIMS')(
|
||||
extra_claims = settings.get('OIDC_EXTRA_SCOPE_CLAIMS')(
|
||||
self.token.user, self.token.scope)
|
||||
|
||||
dic.update(extra_claims.create_response_dic())
|
||||
|
|
|
@ -15,7 +15,7 @@ def create_id_token_dic(user, iss, aud):
|
|||
|
||||
Return a dic.
|
||||
"""
|
||||
expires_in = settings.get('DOP_IDTOKEN_EXPIRE')
|
||||
expires_in = settings.get('OIDC_IDTOKEN_EXPIRE')
|
||||
|
||||
now = timezone.now()
|
||||
|
||||
|
@ -62,7 +62,7 @@ def create_token(user, client, id_token_dic, scope):
|
|||
|
||||
token.refresh_token = uuid.uuid4().hex
|
||||
token.expires_at = timezone.now() + timedelta(
|
||||
seconds=settings.get('DOP_TOKEN_EXPIRE'))
|
||||
seconds=settings.get('OIDC_TOKEN_EXPIRE'))
|
||||
token.scope = scope
|
||||
|
||||
return token
|
||||
|
|
|
@ -3,16 +3,17 @@ from oidc_provider.lib.claims import AbstractScopeClaims
|
|||
|
||||
|
||||
# Here goes all the package default settings.
|
||||
|
||||
default_settings = {
|
||||
# Required.
|
||||
'LOGIN_URL': None,
|
||||
'SITE_URL': None,
|
||||
|
||||
# Optional.
|
||||
'DOP_CODE_EXPIRE': 60*10,
|
||||
'DOP_EXTRA_SCOPE_CLAIMS': AbstractScopeClaims,
|
||||
'DOP_IDTOKEN_EXPIRE': 60*10,
|
||||
'DOP_TOKEN_EXPIRE': 60*60,
|
||||
'OIDC_CODE_EXPIRE': 60*10,
|
||||
'OIDC_EXTRA_SCOPE_CLAIMS': AbstractScopeClaims,
|
||||
'OIDC_IDTOKEN_EXPIRE': 60*10,
|
||||
'OIDC_TOKEN_EXPIRE': 60*60,
|
||||
}
|
||||
|
||||
def get(name):
|
||||
|
|
Loading…
Reference in a new issue