Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

How to get new token after 1 hour programtically? #506

Closed
orchestor opened this issue Apr 26, 2017 · 4 comments
Closed

How to get new token after 1 hour programtically? #506

orchestor opened this issue Apr 26, 2017 · 4 comments

Comments

@orchestor
Copy link

I am trying to find an endpoint but can not find it. Any pointer on this?

@jscholes
Copy link

jscholes commented Apr 26, 2017

When you request the initial access token, it will come with a refresh token. You can use that later to renew the access token once (or just before) it expires. More information is available in the Web API Authorization Guide under steps 5 and 7 of the Authorization Code Flow.

@arirawr
Copy link

arirawr commented May 2, 2017

@jscholes is correct - you need to use refresh tokens. The authorization guide he linked should walk you through that.

@arirawr arirawr closed this as completed May 2, 2017
@NikicaCh
Copy link

@jscholes can I make the request for a new access token in the client side ?
And also can the user continue using my app after the first access token expires and without refreshing the app.
Thanks

@jscholes
Copy link

To refresh an access token using a previously-obtained refresh token, you need to send your application's client ID and client secret in the Authorization header of the request to the /api/token endpoint. Therefore, you should probably perform the request server-side to prevent the client secret being made available to your users. But yes, you can refresh the token client-side if you decide that's appropriate.

Once an access token has expired, it can no longer be used. If you're running a web application in a user's browser, you'll need to find a way to refresh the access token when necessary. How you go about that is up to you, but there should be no need for the user to refresh the page to accomplish it if you don't want them to have to do so.

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

No branches or pull requests

4 participants