jaroslawhartman/withings-sync

withings_sync.garmin.APIException: SSO error 403

Closed this issue · 3 comments

I'm getting the following response from Garmin's API after the initial token and refresh token are retrieved. It's been happening for a few days. I tried deleting my local user settings and re-generating the token but it still happens.

2021-05-20 13:02:51,344 - withings - INFO - https://account.withings.com/oauth2_user/authorize2?response_type=code&client_id=183e03e1f363110b3551f96765c98c10e8f1aa647a37067a1cb64bbbaf491626&state=OK&scope=user.metrics&redirect_uri=https://jaroslawhartman.github.io/withings-sync/contrib/withings.html&
2021-05-20 13:02:51,344 - withings - INFO -
Token : xxxxxxx
2021-05-20 13:03:12,438 - withings - INFO - Get Access Token
2021-05-20 13:03:12,955 - withings - INFO - Refresh Access Token
2021-05-20 13:03:15,149 - withings - INFO - Get Measurements
2021-05-20 13:03:15,641 - root - INFO - No Trainerroad username or a new measurement - skipping sync

Traceback (most recent call last):
  File ".venv/bin/withings-sync", line 8, in <module>
    sys.exit(main())
  File ".venv/lib/python3.8/site-packages/withings_sync/sync.py", line 191, in main
    sync(**vars(args))
  File ".venv/lib/python3.8/site-packages/withings_sync/sync.py", line 179, in sync
    session = garmin.login(garmin_username, garmin_password)
  File ".venv/lib/python3.8/site-packages/withings_sync/garmin.py", line 156, in login
    session = self._get_session(email=username, password=password)
  File ".venv/lib/python3.8/site-packages/withings_sync/garmin.py", line 93, in _get_session
    raise APIException('SSO error %s %s' % (ssoResp.status_code, ssoResp.text))
withings_sync.garmin.APIException: SSO error 403 <html lang="en-US" class="no-js" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta charset="utf-8" />
  <title>Garmin: Maintenance</title>

.....

        <h1 class="app__heading">We’re sorry.</h1>
        <p class="app__subheading">Something went wrong, and our site is temporarily unavailable.<br />We’re already working to get things back on course.</h2>

        <div class="app__error__details">
          <div class="cf-error-details cf-error-1020">
  <h1>Access denied</h1>
  <p>This website is using a security service to protect itself from online attacks.</p>
  <ul class="cferror_details">
    <li>Ray ID: xxxxxx</li>
    <li>Timestamp: 2021-05-20 20:03:15 UTC</li>
    <li>Your IP address: xxxxxx</li>
    <li class="XXX_no_wrap_overflow_hidden">Requested URL: sso.garmin.com/sso/login?service=https%3A%2F%2Fconnect.garmin.com%2Fmodern&amp;clientId=GarminConnect&amp;gauthHost=https%3A%2F%2Fsso.garmin.com%2Fsso&amp;consumeServiceTicket=false </li>
    <li>Error reference number: 1020</li>
    <li>Server ID: FL_12F516</li>
    <li>User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36</li>
  </ul>
</div>

Please make sure you are using the latest version. This issue is already fixed.

you issue has been fixed here: #24

stv0g commented

Seems like your IP has been blocked/banned by Cloudflare for security purposes:

This website is using a security service to protect itself from online attacks.

Garmin has put their Garmin Connect API behind Cloudflare for some weeks now.

I will close this issue and continue the discussion here #31