Skip to content

Commit dce19b2

Browse files
cyberjunkyclaude
andcommitted
revert: undo widget service URL change — CAS tickets are not portable
Testing confirmed the embed SSO only issues tickets scoped to sso_embed. Changing service= to _ios_service_url causes the DI exchange to reject the ticket with "invalid service ticket provided", and the JWT_WEB fallback then tries to hit mobile.integration.garmin.com which is not DNS-resolvable from desktop environments. The ticket regex improvement (\?ticket= instead of embed\?ticket=) is kept as it is strictly more flexible. The root cause of issue #369 ("Token is not active") is server-side: Garmin's API tier rejecting tokens issued via the sso/embed path. No client-side fix is possible for the widget strategy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3299db8 commit dce19b2

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

garminconnect/client.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -456,13 +456,10 @@ def _widget_web_login(self, email: str, password: str) -> None:
456456
"embedWidget": "true",
457457
"gauthHost": sso_base,
458458
}
459-
# Use the iOS mobile service URL as the SSO service so the CAS ticket
460-
# is issued for mobile.integration.garmin.com. Since ~2026-06-01
461-
# Garmin's API tier rejects DI tokens whose audience is sso/embed.
462459
signin_params = {
463460
**embed_params,
464461
"gauthHost": sso_embed,
465-
"service": self._ios_service_url,
462+
"service": sso_embed,
466463
"source": sso_embed,
467464
"redirectAfterAccountLoginUrl": sso_embed,
468465
"redirectAfterAccountCreationUrl": sso_embed,
@@ -566,9 +563,7 @@ def _widget_web_login(self, email: str, password: str) -> None:
566563
if not ticket_match:
567564
raise GarminConnectConnectionError("Widget login: missing service ticket")
568565

569-
self._establish_session(
570-
ticket_match.group(1), sess=sess, service_url=self._ios_service_url
571-
)
566+
self._establish_session(ticket_match.group(1), sess=sess, service_url=sso_embed)
572567

573568
def _complete_mfa_widget(self, mfa_code: str) -> None:
574569
"""Complete MFA for widget flow."""
@@ -610,7 +605,7 @@ def _complete_mfa_widget(self, mfa_code: str) -> None:
610605
self._establish_session(
611606
ticket_match.group(1),
612607
sess=sess,
613-
service_url=self._ios_service_url,
608+
service_url=f"{self._sso}/sso/embed",
614609
)
615610

616611
# ------------------------------------------------------------------ #

0 commit comments

Comments
 (0)