# Errors following Keycloak Update

**URL:** <https://discourse.nodered.org/t/errors-following-keycloak-update/75161>\
**Category:** General\
**Tags:** security\
**Created:** [14 February 2023 08:01 UTC](https://discourse.nodered.org/t/errors-following-keycloak-update/75161 "2023-02-14T08:01:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![razvang](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@razvang](https://discourse.nodered.org/u/razvang)\
**Post date:** [14 February 2023 08:01 UTC](https://discourse.nodered.org/t/errors-following-keycloak-update/75161/1 "2023-02-14T08:01:13Z")

</div>

Hello,

We have an app which uses node red (node js app using module "node-red": "1.3.5") and integrates with a keycloak server running on one of our own AKS clusters. We've been running version 17.0.0 of keycloak and recently we've tried to update keycloak to 20.0.2. We've followed the Keycloak upgrade guide here: [Upgrading Guide](https://www.keycloak.org/docs/latest/upgrading/index.html). From the Keycloak server standpoint the upgrade seems to have been a success (we are running the target version and all the data seems to be in place). However, as soon as we've upgraded keycloak we've started getting errors like:

```auto
2023-02-09 14:20:10,990 WARN [org.keycloak.events] (executor-thread-36) type=REFRESH_TOKEN_ERROR, realmId=XXXXXX-XXXX...., clientId=XXXXX, userId=XXXXXX-XXXX-...., ipAddress=X.X.X.X, error=invalid_token, grant_type=refresh_token, refresh_token_type=Refresh, refresh_token_id=XXXXXXX-XXXX-..., client_auth_method=client-secret

2023-02-09 14:32:27,649 WARN [org.keycloak.events] (executor-thread-36) type=CODE_TO_TOKEN_ERROR, realmId=XXXXXX-XXXX-..., clientId=XXXXX, userId=null, ipAddress=X.X.X.X, error=invalid_code, grant_type=authorization_code, code_id=XXXXXX-XXXX-..., client_auth_method=client-secret

2023-02-09 14:41:21,472 WARN [org.keycloak.events] (executor-thread-37) type=USER_INFO_REQUEST_ERROR, realmId=XXXXXX-XXXX-..., clientId=XXXX, userId=null, ipAddress=X.X.X.X, error=user_session_not_found, auth_method=validate_access_token

```

One of the last items in the Keycloak Upgrade guide speaks about upgrading keycloak adapters. From what I understood these are essentially how your app integrates with Keycloak. Since we do this through node-red is it possible that since we've updated our keycloak server we would also have to update our node-red module and this errors are caused by the fact that we didn't do this?

Also, apologies if I am not posting this where I should.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [14 February 2023 08:55 UTC](https://discourse.nodered.org/t/errors-following-keycloak-update/75161/2 "2023-02-14T08:55:35Z")

</div>

Hi @razvang, welcome to the forums.

Sorry, not entirely sure where Node RED fits into this?

Are you using a custom module to do Authentication in Node RED?  
and are you saying you're using Node RED in an embedded manner in your own Node App?

if so, you may need to raise an issue with the author, or, as you said, update it.

Could you give us a bit more on the schematics?  
what custom module are you using?

---

<div class="post-metadata">

**Author:** ![razvang](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@razvang](https://discourse.nodered.org/u/razvang)\
**Post date:** [14 February 2023 16:57 UTC](https://discourse.nodered.org/t/errors-following-keycloak-update/75161/3 "2023-02-14T16:57:23Z")

</div>

I am using a modified version of NodeRed with oidc authentication enabled to authenticate users. The module I am using for authentication in NodeRed is specifically aimed at oidc authentication using KeyCloak. This is the package I installed: [**https://www.npmjs.com/package/@exlinc/keycloak-passport**](https://www.npmjs.com/package/@exlinc/keycloak-passport)

After updating KeyCloak, I get the errors mentioned above.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [14 February 2023 17:17 UTC](https://discourse.nodered.org/t/errors-following-keycloak-update/75161/4 "2023-02-14T17:17:37Z")

</div>

Hi @razvang

Ok, my guess is the module/auth strategy you are using, likely falls foul of the most recent Keycloak server, The best course of action, is to raise an issue with the module developer or check if there is an update available for it?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 April 2023 17:18 UTC](https://discourse.nodered.org/t/errors-following-keycloak-update/75161/5 "2023-04-15T17:18:21Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
