summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Huot <jonathan.huot@thomsonreuters.com>2019-02-21 10:16:55 +0100
committerJonathan Huot <jonathan.huot@thomsonreuters.com>2019-07-04 11:14:50 +0200
commitc17a4a25a71b3b342ad522427c23038f417fb22e (patch)
tree50d10830a46013b069ae84d5b9d993cbce56a0c7
parent66d7c0035a8d33109ffaec9c8a620dd40255f99d (diff)
downloadoauthlib-c17a4a25a71b3b342ad522427c23038f417fb22e.tar.gz
Add authorization "state" preservation back for AuthCode
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py b/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
index c77d18e..c0cf86d 100644
--- a/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
+++ b/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
@@ -43,6 +43,13 @@ class PreservationTest(TestCase):
def test_state_preservation(self):
auth_uri = 'http://example.com/path?state=xyz&client_id=abc&response_type='
+ # authorization grant
+ h, _, s = self.web.create_authorization_response(
+ auth_uri + 'code', scopes=['random'])
+ self.assertEqual(s, 302)
+ self.assertIn('Location', h)
+ self.assertEqual(get_query_credentials(h['Location'])['state'][0], 'xyz')
+
# implicit grant
h, _, s = self.mobile.create_authorization_response(
auth_uri + 'token', scopes=['random'])