summaryrefslogtreecommitdiff
path: root/tests/openid/connect/core/test_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/openid/connect/core/test_server.py')
-rw-r--r--tests/openid/connect/core/test_server.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/openid/connect/core/test_server.py b/tests/openid/connect/core/test_server.py
index ffab7b0..756c9d0 100644
--- a/tests/openid/connect/core/test_server.py
+++ b/tests/openid/connect/core/test_server.py
@@ -143,7 +143,7 @@ class TokenEndpointTest(TestCase):
@mock.patch('oauthlib.common.generate_token', new=lambda: 'abc')
def test_authorization_grant(self):
- body = 'grant_type=authorization_code&code=abc&scope=all+of+them&state=xyz'
+ body = 'grant_type=authorization_code&code=abc&scope=all+of+them'
headers, body, status_code = self.endpoint.create_token_response(
'', body=body)
token = {
@@ -151,23 +151,27 @@ class TokenEndpointTest(TestCase):
'expires_in': self.expires_in,
'access_token': 'abc',
'refresh_token': 'abc',
- 'scope': 'all of them',
- 'state': 'xyz'
+ 'scope': 'all of them'
}
self.assertEqual(json.loads(body), token)
- body = 'grant_type=authorization_code&code=abc&state=xyz'
+ body = 'grant_type=authorization_code&code=abc'
headers, body, status_code = self.endpoint.create_token_response(
'', body=body)
token = {
'token_type': 'Bearer',
'expires_in': self.expires_in,
'access_token': 'abc',
- 'refresh_token': 'abc',
- 'state': 'xyz'
+ 'refresh_token': 'abc'
}
self.assertEqual(json.loads(body), token)
+ # ignore useless fields
+ body = 'grant_type=authorization_code&code=abc&state=foobar'
+ headers, body, status_code = self.endpoint.create_token_response(
+ '', body=body)
+ self.assertEqual(json.loads(body), token)
+
def test_missing_type(self):
_, body, _ = self.endpoint.create_token_response('', body='')
token = {'error': 'unsupported_grant_type'}