openmhealth / shimmer

An application for reading health data from third-party APIs.
Apache License 2.0
442 stars 122 forks source link

GET http://localhost:8083/registry 404 (Not Found) #99

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi, I'm just trying to get this thing up and running to evaluate it. Following the instructions as best I can... Want to run it on my macbook with Docker.

When I try to use the console ( browse to localhost:8083) by entering a user handle and clicking Find I get a button that doesn't say connect and doesn't do anything.. when I look in the browser console I see errors relating to a missing registry:

ERROR GET http://localhost:8083/registry 404 (Not Found)

Then I tried a different tack and went with the Postman instructions to authorise using postman. Having set up the collection and the environment I used the GET for Initiate Authorisation. But I noticed that it had a null for redirect_url.. and then when I copy/paste the authorizationUrl into the browser and authenticate.. I end up with an error from FitBit that says...

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

Developer information: invalid_request - Invalid redirect_uri parameter value

So, the GET looks like below... I see nulls in the redirect urls... but nowhere in the instructions is this mentioned... do I put it into resource-server.env somehow?

Any help would be greatly appreciated... Thanks PJ

{ "id": "5a14581ec9e77c0007d5a367", "stateKey": "Hxb2es", "username": "pj.mealy@insight-centre.org", "redirectUri": "https://www.fitbit.com/oauth2/authorize", "requestParams": { "redirect_url": null }, "authorizationUrl": "https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=22CL97&redirect_uri=http://localhost:8083/authorize/fitbit/callback&scope=activity%20heartrate%20sleep%20weight&state=Hxb2es&prompt=login%20consent", "clientRedirectUrl": null, "isAuthorized": false, "serializedRequest": "rO0ABXNyAEpvcmcuc3ByaW5nZnJhbWV3b3JrLnNlY3VyaXR5Lm9hdXRoMi5jbGllbnQudG9rZW4uRGVmYXVsdEFjY2Vzc1Rva2VuUmVxdWVzdAyynjYbJPrOAgAGTAAGY29va2lldAASTGphdmEvbGFuZy9TdHJpbmc7TAAKY3VycmVudFVyaXEAfgABTAANZXhpc3RpbmdUb2tlbnQAPkxvcmcvc3ByaW5nZnJhbWV3b3JrL3NlY3VyaXR5L29hdXRoMi9jb21tb24vT0F1dGgyQWNjZXNzVG9rZW47TAAHaGVhZGVyc3QAD0xqYXZhL3V0aWwvTWFwO0wACnBhcmFtZXRlcnN0AChMb3JnL3NwcmluZ2ZyYW1ld29yay91dGlsL011bHRpVmFsdWVNYXA7TAAFc3RhdGV0ABJMamF2YS9sYW5nL09iamVjdDt4cHBwcHNyACxvcmcuc3ByaW5nZnJhbWV3b3JrLnV0aWwuTGlua2VkTXVsdGlWYWx1ZU1hcDTATlwQbMD7AgABTAAJdGFyZ2V0TWFwcQB+AAN4cHNyABdqYXZhLnV0aWwuTGlua2VkSGFzaE1hcDTATlwQbMD7AgABWgALYWNjZXNzT3JkZXJ4cgARamF2YS51dGlsLkhhc2hNYXAFB9rBwxZg0QMAAkYACmxvYWRGYWN0b3JJAAl0aHJlc2hvbGR4cD9AAAAAAAAAdwgAAAAQAAAAAHgAc3EAfgAHc3EAfgAJP0AAAAAAAAx3CAAAABAAAAABdAAFc3RhdGVzcgAUamF2YS51dGlsLkxpbmtlZExpc3QMKVNdSmCIIgMAAHhwdwQAAAABdAAGSHhiMmVzeHgAcA==" }

ghost commented 6 years ago

Ohhkk... So I've just read another issue where a response is saying that the console doesn't actually work presently.

Grand.. so I'm concentrating on using Postman. Could someone please clue me in on the steps to follow in postman?

I presume that after Initiate Authorisation I then need to do Process Authorisation ?

I have gotten a bit further by adding a param to GET Initiate Authorization . I added redirect_url to it in postman and now at least when I paste the authorizationUrl into chrome and get to the authentication with FitBit it gets me as far as the authorization page..

When I click allow I get redirected back to http://localhost:8083/authorize/fitbit/callback#_=_ But that comes up with an error... I caught the return request from fitbit and got the code and the state... but when I plugged them into Process authorization redirect.. I got { "type": "ERROR", "details": "Access token denied.", "accessParameters": null, "requestParameters": null }

I'm not certain where to go next...

Thanks PJ

shannoneobrien commented 6 years ago

Any luck with resolving this issue? We are having the same problem with a project i am working on. @pjatinsight

ghost commented 6 years ago

Hi Shannon, Nope, yours is the first and only response I received. So, when I got no help at all I abandoned Shimmer and I’m just doing it myself with fitbit specific API’s. Sorry I haven’t any better news for you. If its any consolation the API’s that exist for javascript and/or python are relatively easy to use once you get the hang of the Oauth2 concepts. Best Regards, PJ

——————————————

PJ Mealy pj.mealy@insight-centre.org mailto:pj.mealy@insight-centre.org

+353-91-495011

Insight Centre for Data Analytics Galway Business Park Dangan Galway H91 AEX4 Ireland

On 10 Jan 2018, at 18:41, shannoneobrien notifications@github.com wrote:

Any luck with resolving this issue? We are having the same problem with a project i am working on.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openmhealth/shimmer/issues/99#issuecomment-356696658, or mute the thread https://github.com/notifications/unsubscribe-auth/ALgq88eJp3hMCxGHP52QdB9Ovvg2z6g6ks5tJQR1gaJpZM4QmNBW.

enridl commented 6 years ago

same issue for me too. abandoning shimmer since looks no support, but a pity.

Grusinator commented 6 years ago

same here, this should be fixed

enridl commented 6 years ago

abandoned too because of this.

Grusinator commented 6 years ago

But even though the project is not active, it could really be useful to have such a tool. Any of you who have found alternative projects, or willing to share projects that handles this data integration?

Should a new project that tries to solve this be made?

harsh90 commented 6 years ago

Looks like the api doest have a endpoint to fetch the shimer details Quick hack to check how it works Overide the main.js file method

$scope.loadShims = function () { 
          var googlef = {shimKey:"googlefit", label:"https://www.googleapis.com/fitness/v1/users/me/dataSources"};
          var data = [googlef];
          $scope.shims = data;

        }; 

run ./run-dockerized.sh Long term fix registry endpoint should be implemented which will send all the shim details.