From c916e969a369bebeb0fda63ef4d7471d21c3e283 Mon Sep 17 00:00:00 2001 From: Nathan Thomas Date: Wed, 11 Jul 2018 14:57:13 -0600 Subject: [PATCH] Save the token path used for updating with a refreshed token later --- O365/connection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/O365/connection.py b/O365/connection.py index 5753355bfaa4..3567f8faaeae 100644 --- a/O365/connection.py +++ b/O365/connection.py @@ -92,7 +92,7 @@ def __init__(self): self.client_id = None self.client_secret = None self.token = None - + self.token_path = None self.proxy_dict = None def is_valid(self): @@ -133,6 +133,7 @@ def oauth2(client_id, client_secret, store_token=True, token_path=None): connection.api_version = '2.0' connection.client_id = client_id connection.client_secret = client_secret + connection.token_path = token_path if not store_token: delete_token(token_path) @@ -211,7 +212,7 @@ def get_response(request_url, **kwargs): token = connection.oauth.refresh_token(Connection._oauth2_token_url, client_id=connection.client_id, client_secret=connection.client_secret) log.info('New token fetched') - save_token(token) + save_token(token, connection.token_path) response = connection.oauth.get(request_url, **con_params)