Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve expires_in when new access token is fetched automatically from refresh token #125

Closed
djtarazona opened this issue Jul 21, 2016 · 1 comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@djtarazona
Copy link

The callback option #110 added is great, but it only provides the access token. But I'd also like to know when the access token is going to expire. Why not pass the entire access token response to the callback? I am updating my persistent store with the new access token, but need to know when it expires so that the refresh token (already stored) can be used if necessary. And assuming an hour expiration isn't safe.

I suggest changing AuthTokenMiddleware.php#L163 to:

call_user_func($this->tokenCallback, $this->getFullCacheKey(), $auth_tokens);

That way in the callback you can access $auth_tokens['access_token'] and $auth_tokens['expires_in'].

If we need to make this change backwards compatible, we could always do this for now:

call_user_func($this->tokenCallback, $this->getFullCacheKey(), $auth_tokens['access_token'], $auth_tokens);

Please and thank you! :)

@djtarazona djtarazona changed the title Retrieve expires_in when new access token is fetched from refresh token Retrieve expires_in when new access token is fetched automatically from refresh token Jul 21, 2016
@JustinBeckwith JustinBeckwith added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. 🚨 This issue needs some love. labels Jun 1, 2018
@JustinBeckwith JustinBeckwith removed the 🚨 This issue needs some love. label Jun 25, 2018
@vishwarajanand
Copy link
Contributor

Sorry, it took so long for us to come back to it. The current code is here.

Currently, we are not heavily using this codepath. And making this change, seems to be bringing more issues, such as duplicate params to the tokenCallback, etc. I think we better drop this since its already covered by #479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants