Merge pull request #82 from Ivip/v0.3.x

OIDC_IDTOKEN_PROCESSING_HOOK gets user argument.
This commit is contained in:
Juan Ignacio Fiorentino 2016-02-25 10:02:04 -03:00
commit ef45d37157
2 changed files with 4 additions and 2 deletions

View file

@ -49,12 +49,14 @@ def default_after_userlogin_hook(request, user, client):
"""
return None
def default_idtoken_processing_hook(id_token):
def default_idtoken_processing_hook(id_token, user):
"""
Hook to perform some additional actions ti `id_token` dictionary just before serialization.
:param id_token: dictionary contains values that going to be serialized into `id_token`
:type id_token: dict
:param user: user for whom id_token is generated
:type user: User
:return: custom modified dictionary of values for `id_token`
:rtype dict
"""

View file

@ -44,7 +44,7 @@ def create_id_token(user, aud, nonce):
if nonce:
dic['nonce'] = str(nonce)
dic = settings.get('OIDC_IDTOKEN_PROCESSING_HOOK', import_str=True)(dic)
dic = settings.get('OIDC_IDTOKEN_PROCESSING_HOOK', import_str=True)(dic, user=user)
return dic