From fe153f51a6058f8b28ddf066687bb3aa6e5a6413 Mon Sep 17 00:00:00 2001 From: juanifioren Date: Mon, 13 Jul 2015 17:38:03 -0300 Subject: [PATCH] Correct encode_id_token function. --- oidc_provider/lib/endpoints/authorize.py | 5 +---- oidc_provider/lib/endpoints/token.py | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/oidc_provider/lib/endpoints/authorize.py b/oidc_provider/lib/endpoints/authorize.py index 9d6096e..967e0bb 100644 --- a/oidc_provider/lib/endpoints/authorize.py +++ b/oidc_provider/lib/endpoints/authorize.py @@ -114,14 +114,11 @@ class AuthorizeEndpoint(object): # Store the token. token.save() - id_token = encode_id_token( - id_token_dic, self.client.client_secret) - # Create the response uri. uri = self.params.redirect_uri + \ '#token_type={0}&id_token={1}&expires_in={2}'.format( 'bearer', - id_token, + encode_id_token(id_token_dic), 60 * 10, ) diff --git a/oidc_provider/lib/endpoints/token.py b/oidc_provider/lib/endpoints/token.py index 6566f03..72a211d 100644 --- a/oidc_provider/lib/endpoints/token.py +++ b/oidc_provider/lib/endpoints/token.py @@ -84,13 +84,11 @@ class TokenEndpoint(object): # We don't need to store the code anymore. self.code.delete() - id_token = encode_id_token(id_token_dic, self.client.client_secret) - dic = { 'access_token': token.access_token, 'token_type': 'bearer', 'expires_in': settings.get('OIDC_TOKEN_EXPIRE'), - 'id_token': id_token, + 'id_token': encode_id_token(id_token_dic), } return dic