From 4952a6b5e0fd7dfb571184aa61f02c099ca8dfc6 Mon Sep 17 00:00:00 2001 From: ldti Date: Sat, 8 Dec 2018 20:27:08 +0200 Subject: [PATCH] Add files via upload --- shared/zeservices.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/zeservices.py b/shared/zeservices.py index e15af28..35fc521 100644 --- a/shared/zeservices.py +++ b/shared/zeservices.py @@ -27,7 +27,7 @@ def __init__(self, user, password): def getAccessToken(self, user, password): try: # File contains refresh_token followed by the JWT token. - with open('credentials_token.json', 'r') as tokenStorage: + with open('C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\python\credentials_token.json', 'r') as tokenStorage: tokenData = json.load(tokenStorage) # We could be using python_jwt but even the official ZE Services ("decodeToken") does it this crude way, so why overcomplicate things? @@ -56,7 +56,7 @@ def getAccessToken(self, user, password): tokenData['token'] = response['token'] # Save this refresh token and new JWT token so we are nicer to Renault's authentication server. - with open('credentials_token.json', 'w') as outfile: + with open('C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\python\credentials_token.json', 'w') as outfile: json.dump(tokenData, outfile) # Return the token (as-is if valid, refreshed if not). @@ -72,7 +72,7 @@ def getAccessToken(self, user, password): tokenData = {'refresh_token' : api_json['xsrfToken'], 'token' : api_json['token']} # Save this refresh token and JWT token for future use so we are nicer to Renault's authentication server. - with open('credentials_token.json', 'w') as outfile: + with open('C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\python\credentials_token.json', 'w') as outfile: json.dump(tokenData, outfile) # The script will just want the token.