Skip to content

Commit

Permalink
Implicit was not converting expires_in into integers
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanHuot committed Aug 6, 2018
1 parent fbacd77 commit 38467a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions oauthlib/oauth2/rfc6749/parameters.py
Expand Up @@ -279,6 +279,10 @@ def parse_implicit_response(uri, state=None, scope=None):
fragment = urlparse.urlparse(uri).fragment
params = dict(urlparse.parse_qsl(fragment, keep_blank_values=True))

for key in ('expires_in',):
if key in params: # cast things to int
params[key] = int(params[key])

if 'scope' in params:
params['scope'] = scope_to_list(params['scope'])

Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/rfc6749/clients/test_mobile_application.py
Expand Up @@ -40,7 +40,7 @@ class MobileApplicationClientTest(TestCase):
token = {
"access_token": "2YotnFZFEjr1zCsicMWpAA",
"token_type": "example",
"expires_in": "3600",
"expires_in": 3600,
"expires_at": 4600,
"scope": scope,
"example_parameter": "example_value"
Expand Down
2 changes: 1 addition & 1 deletion tests/oauth2/rfc6749/test_parameters.py
Expand Up @@ -86,7 +86,7 @@ def setUp(self):
'access_token': '2YotnFZFEjr1zCsicMWpAA',
'state': state,
'token_type': 'example',
'expires_in': '3600',
'expires_in': 3600,
'expires_at': 4600,
'scope': ['abc']
}
Expand Down

0 comments on commit 38467a8

Please sign in to comment.