Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d853c08

Browse files
committed
remove references to ID token in generic token classes
1 parent 9c06ce6 commit d853c08

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

auth0/v3/authentication/token_verifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ def verify_signature(self, token):
5858
try:
5959
header = jwt.get_unverified_header(token)
6060
except jwt.exceptions.DecodeError:
61-
raise TokenValidationError("ID token could not be decoded.")
61+
raise TokenValidationError("token could not be decoded.")
6262

6363
alg = header.get('alg', None)
6464
if alg != self._algorithm:
6565
raise TokenValidationError(
66-
'Signature algorithm of "{}" is not supported. Expected the ID token '
66+
'Signature algorithm of "{}" is not supported. Expected the token '
6767
'to be signed with "{}"'.format(alg, self._algorithm))
6868

6969
kid = header.get('kid', None)

auth0/v3/test/authentication/test_token_verifier.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ def test_fails_with_none_algorithm(self):
8686
verifier = SymmetricSignatureVerifier("some secret")
8787
with self.assertRaises(Exception) as err:
8888
verifier.verify_signature(jwt)
89-
self.assertEqual(str(err.exception), 'Signature algorithm of "none" is not supported. Expected the ID token to be signed with "HS256"')
89+
self.assertEqual(str(err.exception), 'Signature algorithm of "none" is not supported. Expected the token to be signed with "HS256"')
9090

9191
verifier = AsymmetricSignatureVerifier("some url")
9292
with self.assertRaises(Exception) as err:
9393
verifier.verify_signature(jwt)
9494
self.assertEqual(str(err.exception),
95-
'Signature algorithm of "none" is not supported. Expected the ID token to be signed with "RS256"')
95+
'Signature algorithm of "none" is not supported. Expected the token to be signed with "RS256"')
9696

9797

9898
class TestJwksFetcher(unittest.TestCase):
@@ -249,11 +249,11 @@ def test_err_token_empty(self):
249249

250250
def test_err_token_format_invalid(self):
251251
token = "a.b"
252-
self.assert_fails_with_error(token, "ID token could not be decoded.")
252+
self.assert_fails_with_error(token, "token could not be decoded.")
253253
token = "a.b."
254-
self.assert_fails_with_error(token, "ID token could not be decoded.")
254+
self.assert_fails_with_error(token, "token could not be decoded.")
255255
token = "a.b.c.d"
256-
self.assert_fails_with_error(token, "ID token could not be decoded.")
256+
self.assert_fails_with_error(token, "token could not be decoded.")
257257

258258
def test_HS256_token_signature_passes(self):
259259
token = "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC05OTkiXSwiZXhwIjoxNTg3NzY1MzYxLCJpYXQiOjE1ODc1OTI1NjEsIm5vbmNlIjoiYTFiMmMzZDRlNSIsImF6cCI6InRva2Vucy10ZXN0LTEyMyIsImF1dGhfdGltZSI6MTU4NzY3ODk2MX0.Hn38QVtN_mWN0c-jOa-Fqq69kXpbBp0THsvE-CQ47Ps"
@@ -293,7 +293,7 @@ def test_RS256_token_signature_fails(self):
293293

294294
def test_fails_with_algorithm_not_supported(self):
295295
token = "eyJhbGciOiJub25lIn0.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC05OTkiXSwiZXhwIjoxNTg3NzY1MzYxLCJpYXQiOjE1ODc1OTI1NjEsIm5vbmNlIjoiYTFiMmMzZDRlNSIsImF6cCI6InRva2Vucy10ZXN0LTEyMyIsImF1dGhfdGltZSI6MTU4NzY3ODk2MX0."
296-
self.assert_fails_with_error(token, 'Signature algorithm of "none" is not supported. Expected the ID token to be signed with "RS256"')
296+
self.assert_fails_with_error(token, 'Signature algorithm of "none" is not supported. Expected the token to be signed with "RS256"')
297297
return
298298

299299
def test_fails_with_iss_missing(self):

0 commit comments

Comments
 (0)