how to issue refresh token?
how the refresh token can be created?
or what is the url to issue refresh token?
or anything about it ... plz help
Hi Placebo,
As noted in the Readme, the refresh token implementation is not 100% finished yet.
Currently, refresh_tokens are being issued alongside access_tokens however the ability to use them has not been implemented. Now you've raised it, hopefully we can sort it reasonably soon (unless of course you'd be willing to have a go yourself)
Have added support + filled out the Readme, give me a shout if you have any problems
did u update the npm package version ?
how to use it ? how client should request a new token by the refresh token?
Yes, we're on 1.4 now.
Good point, I will add some more general documentation about requesting tokens this week, general idea is that you POST to /oauth/token with client creds, the refresh token and grant_type=refresh_token On 1 Jul 2013 21:23, "sina miandashti" [email protected] wrote:
did u update the npm package version ?
how to use it ? how client should request a new token by the refresh token?
— Reply to this email directly or view it on GitHubhttps://github.com/nightworld/node-oauth2-server/issues/3#issuecomment-20307729 .
so me in my client ... if receive the msg 'token expired' from your module ... then post the expired token and refresh token to oauth/token then your module give me new token?
I've done some doc updates including adding a new example: https://github.com/nightworld/node-oauth2-server#example-using-the-password-grant-type
generate refresh token : any examples ?
gettting new token set using grant type refresh token does not seem to be working . Any inputs ?
@kruti-thukral I think that there is a bug at the (currently) stable version 3.0.1, in line 103 of lib/grant-types/refresh-token-grant-type.js. There is a hardcoded client.id instead of client.clientId. Apparently, it is fixed in tag v4.0.0-dev.1 (but wrong again in tag v4.0.0-dev.2).
I'm not sure about what will be the definitive change; the property at client definition (clientId -> id) or the property at the mentioned condition (id -> clientId), so I'm not making any pull request (yet).
I have an example project using version 3.0.1 with refresh_token grant type working (with a fix for that bug), maybe it can help you :) node-oauth2-server-example
@pedroetb - I dont see any issue with the lib code . I have directly used oauth2-server version 3.0.1 and I have the refresh token working fine.Thanks for the input though . After your comment, i realised something was going wrong with my client id and was a bug in my code . Fixing that resolved the issue.
@kruti-thukral I think that there is a bug at the (currently) stable version 3.0.1, in line 103 of lib/grant-types/refresh-token-grant-type.js. There is a hardcoded
client.idinstead ofclient.clientId. Apparently, it is fixed in tag v4.0.0-dev.1 (but wrong again in tag v4.0.0-dev.2).I'm not sure about what will be the definitive change; the property at client definition (clientId -> id) or the property at the mentioned condition (id -> clientId), so I'm not making any pull request (yet).
I have an example project using version 3.0.1 with refresh_token grant type working (with a fix for that bug), maybe it can help you :) node-oauth2-server-example
@pedroetb I tried your example,still error when use refresh_token type,got below error
curl http://localhost:3000/oauth/token \
> -d "grant_type=refresh_token" \
> -d "client_id=application" \
> -d "client_secret=secret" \
> -d "refresh_token=5de9099aa1925063d05b75c4cca4377c9f9982ea" \
> -H "Authorization: Basic YXBwbGljYXRpb246c2VjcmV0" \
> -H "Content-Type: application/x-www-form-urlencoded"
{"statusCode":400,"status":400,"code":400,"message":"Unauthorized client: `grant_type` is invalid","name":"unauthorized_client"}
@leapit discussed and fixed at https://github.com/pedroetb/node-oauth2-server-mongo-example/issues/7