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

Refresh keycloak access token #217

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Refresh keycloak access token #217

wants to merge 3 commits into from

Conversation

leoraba
Copy link
Contributor

@leoraba leoraba commented Mar 12, 2025

Pull Request

Description

This PR adds functionality to refresh the Keycloak access token. It automatically uses the refresh_token to obtain a new access_token when the current one expires

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Tested locally. Sign in to Stage using Keycloak user credential. Go to Profile & Token page and let the session still for more than 5 minutes. Hit refresh button and expect no errors on page. Keycloak version 22

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Additional context

@justincorrigible
Copy link
Member

justincorrigible commented Mar 12, 2025

@MitchellShiell will be happy about this fix! 👍

@leoraba what version of Keycloak is this talking to? is that version documented anywhere?
I recall they changed their endpoints at some point, and that broke some integrations, so it would be useful to keep that at least in Stage's readme, if not also in the code as comments

@leoraba
Copy link
Contributor Author

leoraba commented Mar 12, 2025

Tested using Keycloak V22. And you're right @justincorrigible most of the apiKey functionality won't work in latest version of Keycloak due to the apiKey plugin compatibility.

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

Successfully merging this pull request may close these issues.

2 participants