pipedream
pipedream copied to clipboard
[BUG] Keycloak - Token inactivated after one operation
Describe the bug
Keycloak, after I connected to keycloak account, I can execute an action for example the delete user as below
Though after that, I couldn't fetch data anymore
On the source log, I see the error
2024-05-27 10:01:14 2024-05-27 03:01:14,559 DEBUG [org.keycloak.services.managers.AuthenticationManager] (executor-thread-12) Failed to verify identity token: Token is not active
2024-05-27 10:01:14 2024-05-27 03:01:14,560 DEBUG [org.keycloak.services.resources.admin.AdminRoot] (executor-thread-12) Token not valid
2024-05-27 10:01:14 2024-05-27 03:01:14,560 DEBUG [WebApplicationException] (executor-thread-12) Restarting handler chain for exception exception: jakarta.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized
2024-05-27 10:01:14 at org.keycloak.services.resources.admin.AdminRoot.authenticateRealmAdminRequest(AdminRoot.java:186)
I think the reason is that the token validity of Keycloak is 1 min so it seems you need to refresh the token on the background to keep authenticated.