Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Fix for issue #7 - TypeError: Incorrect padding; #7
Browse files Browse the repository at this point in the history
  • Loading branch information
jacinda committed May 12, 2012
1 parent e602c54 commit c71a1fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exampleapp.py
Expand Up @@ -131,7 +131,8 @@ def get_token():
encoded_data = c.split('.', 2)

sig = encoded_data[0]
data = json.loads(urlsafe_b64decode(str(encoded_data[1])))
data = json.loads(urlsafe_b64decode(str(encoded_data[1]) +
(64-len(encoded_data[1])%64)*"="))

if not data['algorithm'].upper() == 'HMAC-SHA256':
raise ValueError('unknown algorithm {0}'.format(data['algorithm']))
Expand Down

0 comments on commit c71a1fb

Please sign in to comment.