Refresh IDP tokens in cluster mode

Hello,

I have a Keycloak cluster with 2 nodes (A and B) and an Identity Provider set up and the following scenario:

  • request token_exchange between Keycloak and IDP from node A => everything works as expected and the new IDP tokens are retrieved
  • after the new IDP token expires request token_exchange between Keycloak and IDP from node B => I got invalid_token error

I noticed that the Keycloak tokens obtained from the token_exchange between Keycloak and IDP are not shared between the nodes. Do you know if is there a way we can share those tokens between the nodes?

Thank you!