From 3a4160451c1c210419606c5b26bbbc813c205fe0 Mon Sep 17 00:00:00 2001 From: bazza2000 Date: Mon, 23 Mar 2026 06:43:53 +0000 Subject: [PATCH] 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. --- src/volvo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/volvo.py b/src/volvo.py index b901d7e..35aeb4d 100644 --- a/src/volvo.py +++ b/src/volvo.py @@ -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()