summaryrefslogtreecommitdiff
path: root/oauthlib/openid
diff options
context:
space:
mode:
authorJonathan Huot <jonathan.huot@thomsonreuters.com>2019-03-26 16:15:13 +0100
committerJonathan Huot <jonathan.huot@thomsonreuters.com>2019-03-26 16:15:13 +0100
commit09538c93d562f6230f3d257b6782d58eeb0a7c3e (patch)
tree20133dd49ca45b557a098d4866e6fab915b161ce /oauthlib/openid
parent4877b4837a9355bc74c9f3d59343d689be4c86fa (diff)
downloadoauthlib-09538c93d562f6230f3d257b6782d58eeb0a7c3e.tar.gz
Add unittests for OIDC GrantTypeBase.
Rename hash_id_token into id_token_hash
Diffstat (limited to 'oauthlib/openid')
-rw-r--r--oauthlib/openid/connect/core/grant_types/base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/oauthlib/openid/connect/core/grant_types/base.py b/oauthlib/openid/connect/core/grant_types/base.py
index c5d91e7..6272ea2 100644
--- a/oauthlib/openid/connect/core/grant_types/base.py
+++ b/oauthlib/openid/connect/core/grant_types/base.py
@@ -51,7 +51,7 @@ class GrantTypeBase(object):
raise InvalidRequestError(description="Malformed claims parameter",
uri="http://openid.net/specs/openid-connect-core-1_0.html#ClaimsParameter")
- def hash_id_token(self, value, hashfunc=hashlib.sha256):
+ def id_token_hash(self, value, hashfunc=hashlib.sha256):
"""
Its value is the base64url encoding of the left-most half of the
hash of the octets of the ASCII representation of the access_token
@@ -134,7 +134,7 @@ class GrantTypeBase(object):
# at_hash MAY NOT be used when:
# - id_token (Implicit)
if "access_token" in token:
- id_token["at_hash"] = self.hash_id_token(token["access_token"])
+ id_token["at_hash"] = self.id_token_hash(token["access_token"])
# c_hash is REQUIRED when response_type value is:
# - code id_token (Hybrid)
@@ -142,7 +142,7 @@ class GrantTypeBase(object):
#
# c_hash is OPTIONAL for others.
if "code" in token:
- id_token["c_hash"] = self.hash_id_token(token["code"])
+ id_token["c_hash"] = self.id_token_hash(token["code"])
# Call request_validator to complete/sign/encrypt id_token
token['id_token'] = self.request_validator.finalize_id_token(id_token, token, token_handler, request)