mirror of
https://github.com/Dielee/volvo2mqtt.git
synced 2026-07-22 02:13:01 +02:00
Fix: use POST for continueAuthentication endpoint (#317)
Volvo's PingFederate auth API now requires a POST request for the continueAuthentication step after OTP verification. Using GET returns the same OTP_VERIFIED state in a loop, never progressing to COMPLETED, which causes a KeyError on 'authorizeResponse'. Changing auth_session.get() to auth_session.post() with an empty JSON body causes the API to return COMPLETED with the expected authorizeResponse.
This commit is contained in:
+1
-1
@@ -114,7 +114,7 @@ def authorize(renew_tokenfile=False):
|
||||
|
||||
def continue_auth(auth_session, data):
|
||||
next_url = data["_links"]["continueAuthentication"]["href"].replace("http://", "https://") + "?action=continueAuthentication"
|
||||
auth = auth_session.get(next_url)
|
||||
auth = auth_session.post(next_url, data="{}")
|
||||
|
||||
if auth.status_code == 200:
|
||||
return auth.json()
|
||||
|
||||
Reference in New Issue
Block a user