From f5540ee4e182b2ac7a9769e7cd1066005a078064 Mon Sep 17 00:00:00 2001 From: creeble Date: Sat, 7 Jan 2023 11:04:28 -0800 Subject: [PATCH] Update WaApi.py Include request to generate a refresh token using APIKEY authentication. Without this, the code is fundamentally broken: Calls to _refresh_auth_token() will always fail. Also, this code is fundamentally broken for python3; python2 is officially deprecated. Oof. --- python/WaApi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/WaApi.py b/python/WaApi.py index 9cbc1fb..35ced85 100644 --- a/python/WaApi.py +++ b/python/WaApi.py @@ -42,7 +42,8 @@ def authenticate_with_apikey(self, api_key, scope=None): scope = "auto" if scope is None else scope data = { "grant_type": "client_credentials", - "scope": scope + "scope": scope, + "obtain_refresh_token": "true" } encoded_data = urllib.parse.urlencode(data).encode() request = urllib.request.Request(self.auth_endpoint, encoded_data, method="POST")