Open saeedesmaili opened 2 years ago
looks like spendee updated the auth to v3. New requests would be:
check password:
curl 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=AIzaSyCCJPDxVNVFEARQ-LxH7q2aZtdQJGGFO84' \
-H 'content-type: application/json' \
--data-raw '{"email":"<EMAIL>","password":"<PASSWORD>","returnSecureToken":true}'
which returns the idToken
and refresh_token
to be used in the next steps
login
curl 'https://api.spendee.com/v3/auth/login' \
-H 'authorization: Bearer <idToken>' \
-H 'content-type: application/json;charset=UTF-8' \
--data-raw '{"global_currency":"USD","default_wallet_name":"Cash Wallet","timezone":"Europe/Bratislava","platform":"web","version":"master","locale":"en_US","credential":null}' \
curl 'https://securetoken.googleapis.com/v1/token?key=AIzaSyCCJPDxVNVFEARQ-LxH7q2aZtdQJGGFO84' \
-H 'content-type: application/x-www-form-urlencoded' \
--data-raw 'grant_type=refresh_token&refresh_token=<refresh_token>' \
--compressed
and that probably gives you access_token
to be used in later calls. At the moment I don't have the time to update the code, but it's basically just replicating the above requests. They also keep changing the API, so I'm not sure how up to date this repo actually is.
Actually, the authentication that this library uses works. I'm able to get details of the wallets and bank accounts, but the sync function doesn't work (and they have changed it apparently).
I checked their requests on the web, and it sends a request to https://api2.spendee.com/v4/connections/{some_token}/refresh-data
and then the page redirects to a third party website. I couldn't reproduce this part, even with replacing the same cookies and headers of my browser. The third-party website doesn't accept my requests, but accepts the ones inside spendee's web app.
hmm I see. I think they basically made a switch from their custom solution to Firebase for syncing and the flow is different. But my v4 spendee app still works, so they still have to do the refresh there somehow
First, thanks for this great repo. The
sync_refresh
seems to be not working, and it returns 404 error: