summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJonathan Huot <jonathan.huot@thomsonreuters.com>2018-11-21 15:17:38 +0100
committerJonathan Huot <jonathan.huot@thomsonreuters.com>2018-11-21 15:17:38 +0100
commite77023ca5db633c5200322cc5ab8f75b22aa7832 (patch)
tree7589258c974adfa9db592594a0eb1c92065d095a /tests
parent7961c4367dda9d604cacb4cba235f9370195d414 (diff)
downloadoauthlib-oauth-metadata.tar.gz
Allow custom provider to override oauthlib valuesoauth-metadata
See https://github.com/oauthlib/oauthlib/pull/605#discussion_r234438151
Diffstat (limited to 'tests')
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_metadata.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/oauth2/rfc6749/endpoints/test_metadata.py b/tests/oauth2/rfc6749/endpoints/test_metadata.py
index a07ba63..301e846 100644
--- a/tests/oauth2/rfc6749/endpoints/test_metadata.py
+++ b/tests/oauth2/rfc6749/endpoints/test_metadata.py
@@ -22,6 +22,16 @@ class MetadataEndpointTest(TestCase):
self.assertIn("grant_types_supported", metadata.claims)
self.assertEqual(metadata.claims["grant_types_supported"], ["password"])
+ def test_token_endpoint_overridden(self):
+ endpoint = TokenEndpoint(None, None, grant_types={"password": None})
+ metadata = MetadataEndpoint([endpoint], {
+ "issuer": 'https://foo.bar',
+ "token_endpoint": "https://foo.bar/token",
+ "grant_types_supported": ["pass_word_special_provider"]
+ })
+ self.assertIn("grant_types_supported", metadata.claims)
+ self.assertEqual(metadata.claims["grant_types_supported"], ["pass_word_special_provider"])
+
def test_mandatory_fields(self):
metadata = MetadataEndpoint([], self.metadata)
self.assertIn("issuer", metadata.claims)