yasoob / nrc-exporter

Download your runs data from Nike Run Club and convert it to GPX format that can be imported in other running apps.
https://yasoob.me/posts/reverse-engineering-nike-run-club-using-frida-android/
MIT License
120 stars 14 forks source link

Unable to get access token #6

Closed jackm closed 4 years ago

jackm commented 4 years ago

After following the steps in the README, I am unable to successfully get my access token.

I am using Linux Ubuntu 18.04.1 and Firefox 78.0.1 (64-bit).

At first I tried using the first method with the geckodriver and providing my credentials to nrc_exporter.py, however after Selenium opens up a Firefox window and tries to login, the Nike site gives me this message:

An error occurred. We are unable to connect to our servers right now. Please try again later. GENERIC "0 - POST request to https://unite.nike.com/login blocked"

I then tried to login manually however I noticed that the Nike site was not adding the com.nike.commerce.snkrs.web.credential key to LocalStorage; the only key present in LocalStorage is uniteLocalStorageCheck which is set to unite, nothing else. Obviously due to the necessary key being missing, using the piece of Javascript code to extract the access token doesn't work either.

When looking at the browser Javascript console after loading the Nike login page, I saw many messages saying

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://insights-collector.newrelic.com/v1/accounts/xxxxxx/events. (Reason: CORS request did not succeed).

I'm not sure if this is relevant to the problem at hand, or if it's just the browser blocking analytics.

yasoob commented 4 years ago

Ok so what you can do is, go to the login page, open developer tools, and try logging in. It will record a couple of requests in the network tab:

image

Click on the /login request and check the response. It will contain the required access_token:

image