diff options
author | Jonathan Huot <JonathanHuot@users.noreply.github.com> | 2018-08-15 00:18:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-15 00:18:12 +0200 |
commit | d6a1281ef1ade14f48bb31976de9319bdb95e846 (patch) | |
tree | af5d51746823c85e07190f80126c27db0c9b0f1c /tests/oauth2/rfc6749/endpoints/test_error_responses.py | |
parent | 058746b3d9bed4aafbd55a7f26491b5761c35fa8 (diff) | |
parent | 21e463712e5de5f2f4866e01d65f8edb8e86994c (diff) | |
download | oauthlib-d6a1281ef1ade14f48bb31976de9319bdb95e846.tar.gz |
Merge branch 'master' into 445_confirm_redirect
Diffstat (limited to 'tests/oauth2/rfc6749/endpoints/test_error_responses.py')
-rw-r--r-- | tests/oauth2/rfc6749/endpoints/test_error_responses.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/oauth2/rfc6749/endpoints/test_error_responses.py b/tests/oauth2/rfc6749/endpoints/test_error_responses.py index 00f7ba6..ef05c4d 100644 --- a/tests/oauth2/rfc6749/endpoints/test_error_responses.py +++ b/tests/oauth2/rfc6749/endpoints/test_error_responses.py @@ -44,6 +44,22 @@ class ErrorResponseTest(TestCase): self.assertRaises(errors.InvalidRedirectURIError, self.mobile.create_authorization_response, uri.format('token'), scopes=['foo']) + def test_invalid_default_redirect_uri(self): + uri = 'https://example.com/authorize?response_type={0}&client_id=foo' + self.validator.get_default_redirect_uri.return_value = "wrong" + + # Authorization code grant + self.assertRaises(errors.InvalidRedirectURIError, + self.web.validate_authorization_request, uri.format('code')) + self.assertRaises(errors.InvalidRedirectURIError, + self.web.create_authorization_response, uri.format('code'), scopes=['foo']) + + # Implicit grant + self.assertRaises(errors.InvalidRedirectURIError, + self.mobile.validate_authorization_request, uri.format('token')) + self.assertRaises(errors.InvalidRedirectURIError, + self.mobile.create_authorization_response, uri.format('token'), scopes=['foo']) + def test_missing_redirect_uri(self): uri = 'https://example.com/authorize?response_type={0}&client_id=foo' |