-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
403 Forbidden Response #55
Comments
Same issue |
Same here |
I tried to debug it for a while. Unforunately I don't know how exactly is GC website working. First I added few constants to Urls.ts: Then I found is that when I copied this call: 'https://connect.garmin.com/modern/preference/[GUID]' to postman and change url to 'https://connect.garmin.com/modern/currentuser-service/user/info' I successfully got user info data. Using the library is not possible. Maybe some cookie is missing or so. |
Garmin has changed the login authentication method, and the previous method is no longer work. I found a great library: Garth (thanks author's hard work), but it is written in Python. I have tried to implement its approach using JavaScript, and it works. I am currently attempting to use its method to modify this library. Once completed, I will submit a merge request. |
Here is a initial version where I have rewritten the |
I have tested this code, and it worked well. I was able to query list of activities, download, edit the activity, etc. Thanks for sharing. I have one question: I suppose this implementation does not handle MFA right? I can see that the Also, maintainer of Garth recommends fetching the consumer key/secret rather than hard coding it, I suppose it could change philosowaffle/peloton-to-garmin#524 (comment) |
For a quick test, MFA is ignored, and consumer key is also hard coded , so I need time to polish it :-) |
I have added a PR to fix most features, waiting for author review and merge it. See #56. I will publish a temporary package to npm, https://www.npmjs.com/package/@gooin/garmin-connect, hope this can help you. @Abasz |
Thanks! It helped a lot, I have updated both my .NET and TS projects :) |
Hi @Pythe1337N Do you have any plans to integrate the fixes that @gooin came up with? |
Thanks for all the effort put into this package and sorry for being unresponsive. I'll check #56 and do a release asap. |
Thanks @Pythe1337N that is very much appreciated. |
Changes from #56 are now merged and released! |
Thanks @Pythe1337N happy to see this merged~ |
Many thanks to everyone who helped fix this. I can confirm it fixed the issue. |
|
@pauly I opened a PR to fix the "getSteps" #58. @Pythe1337N Can you take a look when you have time? |
@pauly general methods seems to be missing, yes. I think you can use GCClient.client.get or copy these lines into a PR: garmin-connect/src/garmin/GarminConnect.ts Line 610 in 39ae27e
Not sure if the session handling is still required though |
I've been able to retrieve activities for many months but this morning I get a 403 response when I call
GCClient.getActivities
.The body does not contain an array of activities, it contains this error object:
{ clientMessage: 'Reference Error ID in error logs for further information', errorId: 'e6b09f8b-b515-4307-bd10-2e07c065f515', error: 'WebApplicationException' }
The stacktrace is:
Unhandled rejection StatusCodeError: 403 - "{\"clientMessage\":\"Reference Error ID in error logs for further information\",\"errorId\":\"48588b72-47c0-4ddb-bfc7-7356464e41a7\",\"error\":\"WebApplicationException\"}" at new StatusCodeError (D:\foo\node_modules\request-promise-core\lib\errors.js:32:15) at plumbing.callback (D:\foo\node_modules\request-promise-core\lib\plumbing.js:104:33) at Request.RP$callback [as _callback] (D:\foo\node_modules\request-promise-core\lib\plumbing.js:46:31) at self.callback (D:\foo\node_modules\request\request.js:185:22) at onRequestComplete (D:\foo\node_modules\cloudscraper\index.js:629:3) at onRequestResponse (D:\foo\node_modules\cloudscraper\index.js:207:5) at Request.<anonymous> (D:\foo\node_modules\cloudscraper\index.js:149:7) at Object.onceWrapper (node:events:628:26) at Request.emit (node:events:513:28) at Request.<anonymous> (D:\foo\node_modules\request\request.js:1154:10) at Request.emit (node:events:513:28) at IncomingMessage.<anonymous> (D:\foo\node_modules\request\request.js:1076:12) at Object.onceWrapper (node:events:627:28) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
I ran an
npm update
and changed to using @garmin/fitsdk (rather than the deprecated @garmin-fit/sdk) but the 403 error still exists.I have no issues logging into Garmin Connect with the same credentials.
The text was updated successfully, but these errors were encountered: