From 88aa1907633611ecad8db006e71029e53bd8a809 Mon Sep 17 00:00:00 2001 From: Morgan Aubert Date: Fri, 28 Sep 2018 19:36:21 -0400 Subject: [PATCH] Fixed #285 -- Ensured standard and custom claims can be used at the same time when using the OIDC_IDTOKEN_INCLUDE_CLAIMS setting --- oidc_provider/lib/utils/token.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/oidc_provider/lib/utils/token.py b/oidc_provider/lib/utils/token.py index d3fd3ab..2301223 100644 --- a/oidc_provider/lib/utils/token.py +++ b/oidc_provider/lib/utils/token.py @@ -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. 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'): custom_claims = settings.get('OIDC_EXTRA_SCOPE_CLAIMS', import_str=True)(token) - claims = custom_claims.create_response_dic() - else: - claims = StandardScopeClaims(token).create_response_dic() - dic.update(claims) + dic.update(custom_claims.create_response_dic()) dic = run_processing_hook( dic, 'OIDC_IDTOKEN_PROCESSING_HOOK',