-
Notifications
You must be signed in to change notification settings - Fork 154
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
fix(tokens): Fixes the potential of deleting a working refresh_token when no new one is available #406
base: develop
Are you sure you want to change the base?
Conversation
ping? |
We have been using this in -production to fix our GSuite 1h-disconnection problems and this has been confirmed to work. |
ping |
@drzraf so actually, in doing some digging on this subject to make sure that things are being handled properly, and to specs. I happened upon an actual reason for why you were having this issue. It has been on the table to quite some time to replace much of the core functionality with a standard Composer package. I happened upon this issue: jumbojett/OpenID-Connect-PHP#286 Which further took me here: https://stackoverflow.com/a/65702100 Basically, what is happening is that once you authenticate the first time with Google you won't get a new refresh token un later requests without using |
An additional follow-up that I happened to come across this MU Plugin that is essentially an add-on for this plugin that addresses the Google refresh token issue. https://gitlab.com/animalequality/wp-openid/-/blob/master/wp-openid.php |
I wrote this code, and having a filter to customize the request (adding |
@drzraf from what I see this isn't some clear problem specifically with this plugin as an issue with Google specifically. I didn't close the PR or issue I simply postponed it until I can find some very clear documentation on all of the handling and can test with other IDPs. The very fact the the code submitted has a comment regarding the scenario of what if the token was actually expired and the comment said "dunno" is not a very confident response to the proper way this should be handled. All of the notes I made were in regards to doing actual research into this issue to ensure that the correct solution is implemented and not just something that appears to be a fox for 1 IDP or use case. |
Hi it is not matter only of one IDP. AWS Cognito also does not have refresh tokens rotation and that is fine with spec. See https://datatracker.ietf.org/doc/html/rfc6749#section-6
|
Just to remind the actual use-case: My users connect to WP using GSuite. Without such a modification of the refresh-token handling, they get disconnected after one hour what is understandably problematic and frustrating. I didn't read the standards and whether IDP is in charge of disconnecting (IMHO identity providing <> session management/duration). |
@drzraf so it's very possible the refresh token issue you are seeing is due to a different bug that has already been fixed but it hasn't been released for this version of the plugin. If you install the version I linked to in the pinned issue about no more updates going to WP.org you might find that your 1 hour timeout issue is fixed. |
All Submissions:
Changes proposed in this Pull Request:
save_refresh_token()
disregard the existing and still validrefresh_token
and replace it with false (since the response to a renewal does not contain it)Closes #404
How to test the changes in this Pull Request:
refresh_token
)Other information:
Changelog entry
Do not empty refresh_token if renewed access tokens do not come with new refresh_token.