openid-connect-generic icon indicating copy to clipboard operation
openid-connect-generic copied to clipboard

Force refresh token

Open rkcreation opened this issue 3 years ago • 1 comments

All Submissions:

Changes proposed in this Pull Request:

Add callable Wordpress action to force a token refresh:

do_action( 'openid-connect-generic-refresh-token' );

How to test the changes in this Pull Request:

  1. Change user realm_access outside of wordpress
  2. Check Wordpress what access_token realm_access contains (outdated informations)
  3. Use the new action do_action( 'openid-connect-generic-refresh-token' );
  4. Check Wordpress what access_token realm_access contains (refreshed informations)

Other information:

  • [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
  • [ ] Have you written new tests for your changes, as applicable?
  • [ ] Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

This PR contains also #338 (required to work). So, for both:

  • Add new wordpress actions: openid-connect-generic-refresh-token and openid-connect-generic-refresh-user-claim
  • Rewrite ensure_tokens_still_fresh to a protected method that handles bool param to force the refresh, no matter if time is expired
  • After the token was refreshed, ensure that user claim is updated (by calling new openid-connect-generic-refresh-user-claim action)

rkcreation avatar Nov 22 '21 21:11 rkcreation

Hi there, We're using this plugin on our website and have recently been facing issues that I have a feeling might be related to what this PR tries to fix. Are there plans for this to be reviewed and released soon? Cheers, Pedro

josepedrocorreia avatar Dec 21 '21 13:12 josepedrocorreia