2727from oidcmsg .exception import OidcMsgError
2828from oidcmsg .exception import SchemeError
2929from oidcmsg .exception import VerificationError
30+ from oidcmsg .message import Message
3031from oidcmsg .message import OPTIONAL_LIST_OF_SP_SEP_STRINGS
3132from oidcmsg .message import OPTIONAL_LIST_OF_STRINGS
3233from oidcmsg .message import OPTIONAL_MESSAGE
3637from oidcmsg .message import SINGLE_OPTIONAL_JSON
3738from oidcmsg .message import SINGLE_OPTIONAL_STRING
3839from oidcmsg .message import SINGLE_REQUIRED_STRING
39- from oidcmsg .message import Message
4040from oidcmsg .message import msg_ser
4141from oidcmsg .oauth2 import ResponseMessage
4242from oidcmsg .time_util import utc_time_sans_frac
@@ -930,6 +930,14 @@ def verify(self, **kwargs):
930930 elif parts .scheme != "https" :
931931 raise SchemeError ("Not HTTPS" )
932932
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+
933941 if "RS256" not in self ["id_token_signing_alg_values_supported" ]:
934942 raise ValueError ('RS256 missing from id_token_signing_alg_values_supported' )
935943
@@ -939,7 +947,7 @@ def verify(self, **kwargs):
939947 raise ValueError ('Issuer ID invalid' )
940948
941949 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 :
943951 raise MissingRequiredAttribute ("token_endpoint" )
944952
945953 return True
0 commit comments