Skip to content

Commit 01c22cf

Browse files
committed
Add tests for non-RS256 sign-alg & failing a none-only sign-alg
1 parent 1897cc3 commit 01c22cf

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/test_06_oidc.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,32 @@ def test_token_endpoint_is_required_for_other_than_implicit_flow_only(self):
516516
with pytest.raises(MissingRequiredAttribute):
517517
ProviderConfigurationResponse(**provider_config).verify()
518518

519+
def test_required_parameters_without_rs256(self):
520+
provider_config = {
521+
"issuer": "https://server.example.com",
522+
"authorization_endpoint": "https://server.example.com/connect/authorize",
523+
"jwks_uri": "https://server.example.com/jwks.json",
524+
"response_types_supported": ["code", "code id_token", "id_token", "token id_token"],
525+
"subject_types_supported": ["public", "pairwise"],
526+
"id_token_signing_alg_values_supported": ["none", "ES256", "HS256"],
527+
}
528+
529+
with pytest.raises(MissingRequiredAttribute):
530+
ProviderConfigurationResponse(**provider_config).verify()
531+
532+
def test_required_parameters_only_none_signing_alg(self):
533+
provider_config = {
534+
"issuer": "https://server.example.com",
535+
"authorization_endpoint": "https://server.example.com/connect/authorize",
536+
"jwks_uri": "https://server.example.com/jwks.json",
537+
"response_types_supported": ["code", "code id_token", "id_token", "token id_token"],
538+
"subject_types_supported": ["public", "pairwise"],
539+
"id_token_signing_alg_values_supported": ["none"],
540+
}
541+
542+
with pytest.raises(ValueError):
543+
ProviderConfigurationResponse(**provider_config).verify()
544+
519545

520546
class TestRegistrationRequest(object):
521547
def test_deserialize(self):

0 commit comments

Comments
 (0)