From 22b234791bddc5542cc74851958e42c4b32b7296 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Wed, 22 Mar 2017 11:34:29 -0500 Subject: [PATCH] Make jwk_data get respect ssl_verify=no Take the value off of the given AuthClient object. Closes #160 --- globus_sdk/auth/token_response.py | 3 ++- tests/unit/test_token_response.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/globus_sdk/auth/token_response.py b/globus_sdk/auth/token_response.py index 04abee415..296f1f357 100644 --- a/globus_sdk/auth/token_response.py +++ b/globus_sdk/auth/token_response.py @@ -116,7 +116,8 @@ def decode_id_token(self, auth_client): logger.debug('Fetch JWK Data: Start') oidc_conf = auth_client.get('/.well-known/openid-configuration') jwks_uri = oidc_conf['jwks_uri'] - jwk_data = requests.get(jwks_uri).json() + # use the auth_client's decision on ssl_verify=yes/no + jwk_data = requests.get(jwks_uri, verify=auth_client._verify).json() logger.debug('Fetch JWK Data: Complete') return jwt.decode( diff --git a/tests/unit/test_token_response.py b/tests/unit/test_token_response.py index cd0c10f5e..4ade5933e 100644 --- a/tests/unit/test_token_response.py +++ b/tests/unit/test_token_response.py @@ -55,6 +55,7 @@ def setUp(self): # mock AuthClient self.ac = mock.Mock() self.ac.client_id = get_client_data()["native_app_client1"]["id"] + self.ac._verify = True self.ac.get = mock.Mock(return_value={ "jwks_uri": u"https://auth.globus.org/jwk.json"})