diff options
author | jturmel <jturmel@gmail.com> | 2014-03-18 12:33:44 -0500 |
---|---|---|
committer | jturmel <jturmel@gmail.com> | 2014-03-18 12:33:44 -0500 |
commit | e3482d8b3db132bed364e5d25db3553c04ef6522 (patch) | |
tree | e7dbc2a8cb9feb5f1a0b4b397834e3fdfc9e797d /oauthlib/common.py | |
parent | 864e6f66cebccbc93d5edeca2d5e1128f1b60181 (diff) | |
download | oauthlib-e3482d8b3db132bed364e5d25db3553c04ef6522.tar.gz |
Change how arbitrary claims are set on crypto token
Diffstat (limited to 'oauthlib/common.py')
-rw-r--r-- | oauthlib/common.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/oauthlib/common.py b/oauthlib/common.py index 4a7404c..044ba43 100644 --- a/oauthlib/common.py +++ b/oauthlib/common.py @@ -241,13 +241,15 @@ def generate_crypto_token(private_pem, request): private_key = RSA.importKey(private_pem) now = datetime.datetime.utcnow() - payload = { + + claims = { 'scope': request.scope, 'exp': now + datetime.timedelta(seconds=request.expires_in) } - request.payload.update(payload) - token = jwt.encode(request.payload, private_key, 'RS256') + claims.update(request.claims) + + token = jwt.encode(claims, private_key, 'RS256') token = to_unicode(token, "UTF-8") return token |