summaryrefslogtreecommitdiff
path: root/oauthlib/oauth2
diff options
context:
space:
mode:
authorJoseph Tate <joseph@crunch.io>2015-04-14 12:30:44 -0400
committerJoseph Tate <joseph@crunch.io>2015-04-14 12:30:44 -0400
commitfc2d1218e015adcf65ba01965884430c47895cd0 (patch)
treec3324d8e5731a0d2866848ee642c09b22db377f2 /oauthlib/oauth2
parente1eee129c074d0de411122d6e1f34a3533952615 (diff)
downloadoauthlib-fc2d1218e015adcf65ba01965884430c47895cd0.tar.gz
Support newer PyJWT (1.0.0). remove PyCrypto completely for cryptography and PyJWT helpers. Reformat some test certificates to be easier to maintain. Update documentation to match use of cryptography instead of PyCrypto
Diffstat (limited to 'oauthlib/oauth2')
-rw-r--r--oauthlib/oauth2/rfc6749/clients/service_application.py3
-rw-r--r--oauthlib/oauth2/rfc6749/utils.py2
2 files changed, 1 insertions, 4 deletions
diff --git a/oauthlib/oauth2/rfc6749/clients/service_application.py b/oauthlib/oauth2/rfc6749/clients/service_application.py
index f60ac4f..36da98b 100644
--- a/oauthlib/oauth2/rfc6749/clients/service_application.py
+++ b/oauthlib/oauth2/rfc6749/clients/service_application.py
@@ -140,14 +140,11 @@ class ServiceApplicationClient(Client):
.. _`Section 3.2.1`: http://tools.ietf.org/html/rfc6749#section-3.2.1
"""
import jwt
- import Crypto.PublicKey.RSA as RSA
key = private_key or self.private_key
if not key:
raise ValueError('An encryption key must be supplied to make JWT'
' token requests.')
- key = RSA.importKey(key)
-
claim = {
'iss': issuer or self.issuer,
'aud': audience or self.issuer,
diff --git a/oauthlib/oauth2/rfc6749/utils.py b/oauthlib/oauth2/rfc6749/utils.py
index e8ffba4..6a8e24b 100644
--- a/oauthlib/oauth2/rfc6749/utils.py
+++ b/oauthlib/oauth2/rfc6749/utils.py
@@ -24,7 +24,7 @@ def list_to_scope(scope):
"""Convert a list of scopes to a space separated string."""
if isinstance(scope, unicode_type) or scope is None:
return scope
- elif isinstance(scope, list):
+ elif isinstance(scope, (tuple, list)):
return " ".join([unicode_type(s) for s in scope])
elif isinstance(scope, set):
return list_to_scope(list(scope))