Correct encode_id_token function.

This commit is contained in:
juanifioren 2015-07-13 17:38:03 -03:00
parent 3498940142
commit fe153f51a6
2 changed files with 2 additions and 7 deletions

View file

@ -114,14 +114,11 @@ class AuthorizeEndpoint(object):
# Store the token. # Store the token.
token.save() token.save()
id_token = encode_id_token(
id_token_dic, self.client.client_secret)
# Create the response uri. # Create the response uri.
uri = self.params.redirect_uri + \ uri = self.params.redirect_uri + \
'#token_type={0}&id_token={1}&expires_in={2}'.format( '#token_type={0}&id_token={1}&expires_in={2}'.format(
'bearer', 'bearer',
id_token, encode_id_token(id_token_dic),
60 * 10, 60 * 10,
) )

View file

@ -84,13 +84,11 @@ class TokenEndpoint(object):
# We don't need to store the code anymore. # We don't need to store the code anymore.
self.code.delete() self.code.delete()
id_token = encode_id_token(id_token_dic, self.client.client_secret)
dic = { dic = {
'access_token': token.access_token, 'access_token': token.access_token,
'token_type': 'bearer', 'token_type': 'bearer',
'expires_in': settings.get('OIDC_TOKEN_EXPIRE'), 'expires_in': settings.get('OIDC_TOKEN_EXPIRE'),
'id_token': id_token, 'id_token': encode_id_token(id_token_dic),
} }
return dic return dic