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

Add openid-connect-generic-session-expired action on session expiry before logout #228

Merged
merged 5 commits into from
Mar 2, 2022

Conversation

jkouris
Copy link
Contributor

@jkouris jkouris commented Sep 10, 2020

Add openid-connect-generic-session-expired action before to allow consumers to act on the refresh token expiration

All Submissions:

Changes proposed in this Pull Request:

Added action 'openid-connect-generic-session-expired' to allow client to react to the session expiry (refresh token expired) just before logging the user out and redirecting them back to the login page. It can be useful in situations where SSO is being used across multiple apps. In this case the user is logged in with the SSO provider via another app, but has timed out of wordpress. This allows a hook to re-authenticate them automatically and allow access to the resource based. The action provides the user and the REDIRECT_URI as parameters to allow any necessary action to be taken on timeout with the url and parameters provided.

Closes # .

How to test the changes in this Pull Request:

  1. Add the following hook in the client code
    add_action('openid-connect-generic-session-expired', 'expired_method', 10, 2);
  2. Start a session with the OpenID Connect provider via wordpress. Close the browser without logging out and wait until the token refresh has expired.
  3. Revisit the wordpress resource and observe the action being fired.

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.

Add openid-connect-generic-session-expired action before to allow consumers to act on the refresh token expiration
@timnolte timnolte added enhancement Issues & PRs related to new features. status: needs review PR that needs review. status: needs docs Needs explanation in release notes, README, or documentation. status: needs changelog Mark all PRs that have not had their changelog entries added. labels Sep 10, 2020
@timnolte timnolte added this to the 3.9 Release milestone Sep 10, 2020
@timnolte timnolte self-assigned this Jan 13, 2021
@timnolte
Copy link
Collaborator

timnolte commented Jan 13, 2021

@jkouris this PR is failing both WordPress coding standards. You can run these check with NPM if you have the local development environment setup.

@timnolte timnolte added this to To do in 3.9.0 Release Jan 30, 2021
@timnolte timnolte moved this from To do to In progress in 3.9.0 Release Jan 30, 2021
@timnolte timnolte added status: approved PRs that have been approved and ready to be merged. and removed status: needs review PR that needs review. labels Feb 25, 2022
Copy link
Collaborator

@timnolte timnolte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkouris I'd like to include this in the next release that I want to push out soon. Can you update this to resolve the Coding Standards issues. You can find the issues here: https://github.com/oidc-wp/openid-connect-generic/runs/5338133715?check_suite_focus=true Thanks!

@jkouris
Copy link
Contributor Author

jkouris commented Feb 26, 2022

@timnolte I have resolved the coding standards issues and verified it passes when running locally

@timnolte timnolte merged commit 71570fb into oidc-wp:dev Mar 2, 2022
3.9.0 Release automation moved this from In progress to Done Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues & PRs related to new features. status: approved PRs that have been approved and ready to be merged. status: needs changelog Mark all PRs that have not had their changelog entries added. status: needs docs Needs explanation in release notes, README, or documentation.
Projects
No open projects
3.9.0 Release
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants