Skip to content
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

Trying to get postman to work with the shim #127

Open
rasalt opened this issue Jun 18, 2021 · 5 comments
Open

Trying to get postman to work with the shim #127

rasalt opened this issue Jun 18, 2021 · 5 comments

Comments

@rasalt
Copy link

rasalt commented Jun 18, 2021

I have the dockerized version of shimmer running.
I've configured postman
Its doing a GET on {{api-base-url}}/authorize/{{shim-key}}?username={{username}}
api-base-url is http://35.222.111.95
shim-key is fitbit
username is user1

shimmer is setup with my fitbit client id/ key etc.
I am getting this error
"Could not get any response
There was an error connecting to http://35.222.111.95/authorize/fitbit?username=user1.
Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
Self-signed SSL certificates are being blocked:
Fix this by turning off 'SSL certificate verification' in Settings > General
Proxy configured incorrectly
Ensure that proxy is configured correctly in Settings > Proxy
Request timeout:
Change request timeout in Settings > General"

I have disabled postman proxy settings and turned off SSL.

Please advise what to expect and how to make progress. I am wanting the open mhealth version and that is it.
Would be very very grateful for the help. Desperately wanting to move past this to have a pipeline flowing through shimmer.

@rasalt
Copy link
Author

rasalt commented Jun 18, 2021

I made a bit of progress and got this as part of the response as part of the "initiate authorization"

"authorizationUrl": "https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=%2223B8T2%22&redirect_uri=http://localhost:80/authorize/fitbit/callback&scope=activity%20heartrate%20sleep%20weight&state=I8XSBu&prompt=login%20consent",

Pasting the url value in the browser gives me this error:

"The app you're trying to connect did not provide valid information to Fitbit. Please report this issue to them.

Developer information: unauthorized_client - Invalid client_id"
In the url, what is the "state" value ? and does that redirect look decent ?

@rasalt
Copy link
Author

rasalt commented Jun 19, 2021

Please advise on the authorizationUrl above.

A followup question is, do you anticipate shimmer to be used in a "pull model" alone ? i.e. applications pulling wearables data at their cadence ? fitbit provides a subscriptions API which can be used to notify applications regarding data availability and the application then makes relevant calls to pull data from the fitbit servers. I didn't find a similar concept and am assuming, seeing the POSTMAN setup that the model assumed is a pull model. Would be super appreciative if someone can confirm. I also don't know whether this repo is still in use or abandoned. Thank you.

@walkabilly
Copy link
Member

The repo is not dead. Thanks for contributing.

  1. Working on the URL question now. Will respond when I have a good answer.
  2. Pull model is correct.

@Nanared1
Copy link

Nanared1 commented Jul 8, 2021

Hi @rasalt, can you please confirm that the redirect_uri is the same URI configured in you Fitbit Developer dashboard? The URIs need to match, otherwise, fitbit won't return any data.

Thank you!

@HimavarshaVS
Copy link

Hi
I've dockerized the application and tried to authorize an user to get data from fitbit. I tried "initiazation request" in postman setup . I received a response like which has clientRedirectUrl : null and requestParams": { "redirect_url": null }
I pasted the authorization url in browser which has a callback url exactly the same as configured in fitbit dev app.
I get Developer information: invalid_request - Invalid redirect_uri parameter value
Can you please help me on this as I couldn't authorize any user .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants