
Manish Dwibedy • over 5 years ago
Error getting access token
Hi, I
I am error in getting the access token.
I hit the url "https://genomelink.io/oauth/authorize?redirect_uri=http://localhost:3000/callback&client_id=XXX&scope=report:openness&response_type=code" to get the callback function to convert the 'code' to an 'access_token'
Please find the following request
METHOD - POST
URL - "https://genomelink.io/oauth/token"
HEADER - 'Content-Type':'application/x-www-form-urlencoded'
BODY -
{
grant_type: 'authorization_code',
code: 'xaPgw0ygME7f7zlDuRptoNsQozJJqL',
client_id: 'XXX',
client_secret: 'YYY',
redirect_uri: 'http://localhost:3000/callback'
}
The response I am getting is {"error": "unsupported_grant_type"}
Any help will be appreciated. :)
Comments are closed.
2 comments
Manish Dwibedy • over 5 years ago
Sorry guys, that was my request issue.
I fixed the Node.JS POST request. Please find the below post to see how to send the request to get the access token.
https://stackoverflow.com/questions/17121846/node-js-how-to-send-headers-with-form-data-using-request-module
Kensuke Numakura Manager • over 5 years ago
Great.
Just for your information, if you are writing the token request code by your own, we recommend to use our Node SDK:
Eg., https://github.com/AWAKENS-dev/api-oauth-example-node-express/blob/c561c71516097b9e491daacec79a8fea4bbc0179/app.js#L41-L50
Hope this helps.