diff options
author | Jonathan Huot <jonathan.huot@thomsonreuters.com> | 2018-12-14 13:05:50 +0100 |
---|---|---|
committer | Jonathan Huot <jonathan.huot@thomsonreuters.com> | 2018-12-14 13:14:12 +0100 |
commit | 7be2769bcfefc5db9b54603dbbbcd4db0d237216 (patch) | |
tree | ce5b47377c53d92f4e58a1b2ce6b4f7724d9cbf2 /tests/oauth2 | |
parent | a068c0b0b757db9f2df45442eb5833ee978568ae (diff) | |
download | oauthlib-7be2769bcfefc5db9b54603dbbbcd4db0d237216.tar.gz |
Fix issue when using Metadata Endpoint with OIDC PreConfigured server.
Diffstat (limited to 'tests/oauth2')
-rw-r--r-- | tests/oauth2/rfc6749/endpoints/test_metadata.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/oauth2/rfc6749/endpoints/test_metadata.py b/tests/oauth2/rfc6749/endpoints/test_metadata.py index 875316a..4813b46 100644 --- a/tests/oauth2/rfc6749/endpoints/test_metadata.py +++ b/tests/oauth2/rfc6749/endpoints/test_metadata.py @@ -14,6 +14,33 @@ class MetadataEndpointTest(TestCase): "issuer": 'https://foo.bar' } + def test_openid_oauth2_preconfigured(self): + default_claims = { + "issuer": 'https://foo.bar', + "authorization_endpoint": "https://foo.bar/authorize", + "revocation_endpoint": "https://foo.bar/revoke", + "introspection_endpoint": "https://foo.bar/introspect", + "token_endpoint": "https://foo.bar/token" + } + from oauthlib.oauth2 import Server as OAuth2Server + from oauthlib.openid import Server as OpenIDServer + + endpoint = OAuth2Server(None) + metadata = MetadataEndpoint([endpoint], default_claims) + oauth2_claims = metadata.claims + + endpoint = OpenIDServer(None) + metadata = MetadataEndpoint([endpoint], default_claims) + openid_claims = metadata.claims + + # Pure OAuth2 Authorization Metadata are similar with OpenID but + # response_type not! (OIDC contains "id_token" and hybrid flows) + del oauth2_claims['response_types_supported'] + del openid_claims['response_types_supported'] + + self.maxDiff = None + self.assertEqual(openid_claims, oauth2_claims) + def test_token_endpoint(self): endpoint = TokenEndpoint(None, None, grant_types={"password": None}) metadata = MetadataEndpoint([endpoint], { |