openmhealth / omh-dsu-ri

An application for storing mobile health data and authorizing access to it.
http://www.openmhealth.org/documentation/#/store-data/storage-overview
Apache License 2.0
39 stars 32 forks source link

Invalid token message #3

Closed Arutchelvi90 closed 9 years ago

Arutchelvi90 commented 9 years ago

Hello I have pulled the access token but then it still says invalid token when i try to pick a request screen shot 2014-12-04 at 10 08 44 pm screen shot 2014-12-04 at 10 09 19 pm

I have attached the screen shots of my environment and error message

Thanks in advance

emersonf commented 9 years ago

Your client details are probably not set up correctly (SO explanation of error is here). Connect to the PostgreSQL database (search for psql in the instructions) and run select * from oauth_client_details; (if you can't read the result, transpose results with \x and rerun the query.) You should get something that looks like

omh=# select * from oauth_client_details;
-[ RECORD 1 ]-----------+------------------------------------------------------
client_id               | testClient
resource_ids            | dataPoint
client_secret           | testClientSecret
scope                   | read_data_points,write_data_points,delete_data_points
authorized_grant_types  | authorization_code,implicit,password,refresh_token
web_server_redirect_uri | 
authorities             | ROLE_CLIENT
access_token_validity   | 
refresh_token_validity  | 
additional_information  | 
autoapprove             | 

Check if your resource_ids column has dataPoint.

Arutchelvi90 commented 9 years ago

is it does have datapoints screen shot 2014-12-05 at 11 56 55 am

Arutchelvi90 commented 9 years ago

Got it thank u so much

Arutchelvi90 commented 9 years ago

I have one final question. We are working on air quality monitoring systems my question can we buid AQM on top of open nhealth I provided the link of api's used

http://developer.sensordrone.com/android/api/

Thank you On Dec 5, 2014 12:41 PM, "arut chelvi" arutchelviangappan@gmail.com wrote:

Got it thank u so much

emersonf commented 9 years ago

Yep. You'd write an Android app which gets an access token from the authorization server, pulls data from the Sensordrone API, and writes that data to the resource server. We've been talking about creating an Android library that provides that auth server and resource server API client code, but haven't gotten around to it yet. If you work on it and open-source the client code, that would really help us, so please let us know.

I'm closing this issue since you've connected to the resource server. Feel free to use the developer group for any general questions, or GitHub issues for code/functionality questions.

Arutchelvi90 commented 9 years ago

Nice. Is there any article or paper material available that I could read to get an in-depth knowledge about this. Am trying to figure out the difference between the open mhealth and sendordrone API . It would be really helpful

Thank you Arut On Dec 7, 2014 6:46 AM, "Emerson Farrugia" notifications@github.com wrote:

Yep. You'd write an Android app which gets an access token from the authorization server, pulls data from the Sensordrone API, and writes that data to the resource server. We've been talking about creating an Android library that provides that auth server and resource server API client code, but haven't gotten around to it yet. If you work on it and open-source the client code, that would really help us, so please let us know.

I'm closing this issue since you've connected to the resource server. Feel free to use the developer group https://groups.google.com/forum/#!forum/omh-developers for any general questions, or GitHub issues for code/functionality questions.

— Reply to this email directly or view it on GitHub https://github.com/openmhealth/omh-dsu-ri/issues/3#issuecomment-65937825 .