Giter Club home page Giter Club logo

Comments (7)

omriasta avatar omriasta commented on June 3, 2024

Haven't looked at this in a while since they added the sync directly to the app. It looks like they may have changed the website, I'll take a look as soon as I have a chance tomorrow.

from ifitsync.

omriasta avatar omriasta commented on June 3, 2024

It looks the same to me. Can you go to https://www.ifit.com/settings/apps
And right click-> view source
Then search for "clientid" ? There should be a few entries joined by a "clientsecret". The script is basically trying to scrape these values. It's possible that since you are signing in with Google credentials that the scrape is failing. After that, all the interactions are with the API directly, just not sure how that will react with Google credentials as well...

from ifitsync.

harphere avatar harphere commented on June 3, 2024

Thanks for getting back quickly. I overlooked adding an app in my profile. Got it working now, thanks again.

from ifitsync.

omriasta avatar omriasta commented on June 3, 2024

Glad it worked out!

from ifitsync.

srsholmes avatar srsholmes commented on June 3, 2024

It looks the same to me. Can you go to https://www.ifit.com/settings/apps And right click-> view source Then search for "clientid" ? There should be a few entries joined by a "clientsecret". The script is basically trying to scrape these values. It's possible that since you are signing in with Google credentials that the scrape is failing. After that, all the interactions are with the API directly, just not sure how that will react with Google credentials as well...

Hey I don't suppose you have had issues with the ifit API being unauthorized using this method of authentication?

I am getting the following response when trying to authenticate

{ code: 'UnauthorizedError', message: 'Unauthorized' }

I feel like they have changed their API recently, and the clientID / Secret no longer is working for me.

For reference, this is my authentication post, written as a fetch in TS.

const res: iFitAuthResponse = await fetch(
    'https://api.ifit.com/oauth/token',
    {
      method: 'POST',
      body: JSON.stringify({
        grant_type: 'refresh_token',
        refresh_token: credentials['refresh_token'],
        client_id: process.env.IFIT_CLIENT_ID,
        client_secret: process.env.IFIT_CLIENT_SECRET,
      }),
      headers: {
        Host: 'api.ifit.com',
        Connection: 'keep-alive',
        Origin: 'https://onboarding-webview.ifit.com',
        'User-Agent':
          'Mozilla/5.0 (Linux; Android 6.0; Google Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.186 Safari/537.36',
        'content-type': 'application/json',
        Accept: '*/*',
        Referer:
          'https://onboarding-webview.ifit.com/0.27.0/index.html?page=login-email',
        'Accept-Encoding': 'gzip, deflate',
        'Accept-Language': 'en-US,en;q=0.9',
        'X-Requested-With': 'com.ifit.wolf',
      },
    }
  ).then((x) => x.json());

Do you happen to know if there are any additional / changed headers needed to auth now?

from ifitsync.

omriasta avatar omriasta commented on June 3, 2024

I haven't had any issues getting refresh tokens but I haven't tried to "re-authenticate" in a very long time. My script has been working for me without issues.

from ifitsync.

srsholmes avatar srsholmes commented on June 3, 2024

Thanks for letting me know, I'll investigate further a d post a solution if I find one 👍

from ifitsync.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.