Fixed #285 -- Ensured standard and custom claims can be used at the same time when using the OIDC_IDTOKEN_INCLUDE_CLAIMS setting
This commit is contained in:
parent
b5e055205c
commit
88aa190763
1 changed files with 3 additions and 4 deletions
|
@ -55,12 +55,11 @@ def create_id_token(token, user, aud, nonce='', at_hash='', request=None, scope=
|
||||||
|
|
||||||
# Inlude (or not) user standard claims in the id_token.
|
# Inlude (or not) user standard claims in the id_token.
|
||||||
if settings.get('OIDC_IDTOKEN_INCLUDE_CLAIMS'):
|
if settings.get('OIDC_IDTOKEN_INCLUDE_CLAIMS'):
|
||||||
|
standard_claims = StandardScopeClaims(token)
|
||||||
|
dic.update(standard_claims.create_response_dic())
|
||||||
if settings.get('OIDC_EXTRA_SCOPE_CLAIMS'):
|
if settings.get('OIDC_EXTRA_SCOPE_CLAIMS'):
|
||||||
custom_claims = settings.get('OIDC_EXTRA_SCOPE_CLAIMS', import_str=True)(token)
|
custom_claims = settings.get('OIDC_EXTRA_SCOPE_CLAIMS', import_str=True)(token)
|
||||||
claims = custom_claims.create_response_dic()
|
dic.update(custom_claims.create_response_dic())
|
||||||
else:
|
|
||||||
claims = StandardScopeClaims(token).create_response_dic()
|
|
||||||
dic.update(claims)
|
|
||||||
|
|
||||||
dic = run_processing_hook(
|
dic = run_processing_hook(
|
||||||
dic, 'OIDC_IDTOKEN_PROCESSING_HOOK',
|
dic, 'OIDC_IDTOKEN_PROCESSING_HOOK',
|
||||||
|
|
Loading…
Reference in a new issue