27
27
from oidcmsg .exception import OidcMsgError
28
28
from oidcmsg .exception import SchemeError
29
29
from oidcmsg .exception import VerificationError
30
+ from oidcmsg .message import Message
30
31
from oidcmsg .message import OPTIONAL_LIST_OF_SP_SEP_STRINGS
31
32
from oidcmsg .message import OPTIONAL_LIST_OF_STRINGS
32
33
from oidcmsg .message import OPTIONAL_MESSAGE
36
37
from oidcmsg .message import SINGLE_OPTIONAL_JSON
37
38
from oidcmsg .message import SINGLE_OPTIONAL_STRING
38
39
from oidcmsg .message import SINGLE_REQUIRED_STRING
39
- from oidcmsg .message import Message
40
40
from oidcmsg .message import msg_ser
41
41
from oidcmsg .oauth2 import ResponseMessage
42
42
from oidcmsg .time_util import utc_time_sans_frac
@@ -930,6 +930,14 @@ def verify(self, **kwargs):
930
930
elif parts .scheme != "https" :
931
931
raise SchemeError ("Not HTTPS" )
932
932
933
+ # The parameter is optional
934
+ if "token_endpoint_auth_signing_alg_values_supported" in self and "none" in self [
935
+ "token_endpoint_auth_signing_alg_values_supported" ]:
936
+ raise ValueError (
937
+ "The value none must not be used for "
938
+ "token_endpoint_auth_signing_alg_values_supported"
939
+ )
940
+
933
941
if "RS256" not in self ["id_token_signing_alg_values_supported" ]:
934
942
raise ValueError ('RS256 missing from id_token_signing_alg_values_supported' )
935
943
@@ -939,7 +947,7 @@ def verify(self, **kwargs):
939
947
raise ValueError ('Issuer ID invalid' )
940
948
941
949
if any ("code" in rt for rt in self [
942
- "response_types_supported" ]) and "token_endpoint" not in self :
950
+ "response_types_supported" ]) and "token_endpoint" not in self :
943
951
raise MissingRequiredAttribute ("token_endpoint" )
944
952
945
953
return True
0 commit comments