-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
core
Describe the bug
There's a problem in "version" column of above entities, that results in error when user tries to login in a offline session.
- PersistentUserSessionEntity.java
https://github.com/keycloak/keycloak/blob/main/model/jpa/src/main/java/org/keycloak/models/jpa/session/PersistentUserSessionEntity.java
- PersistentClientSessionEntity.java
https://github.com/keycloak/keycloak/blob/main/model/jpa/src/main/java/org/keycloak/models/jpa/session/PersistentClientSessionEntity.java
Keycloak tries to query version in lowercase, but in database the version column is UPPERCASE
select top ? puse1_0.OFFLINE_FLAG,puse1_0.USER_SESSION_ID,puse1_0.BROKER_SESSION_ID,puse1_0.CREATED_ON,puse1_0.DATA,puse1_0.LAST_SESSION_REFRESH,puse1_0.REALM_ID,puse1_0.USER_ID,puse1_0.version from OFFLINE_USER_SESSION puse1_0 where puse1_0.OFFLINE_FLAG=? and puse1_0.USER_SESSION_ID=? and puse1_0.REALM_ID=?
select pcse1_0.CLIENT_ID,pcse1_0.CLIENT_STORAGE_PROVIDER,pcse1_0.EXTERNAL_CLIENT_ID,pcse1_0.OFFLINE_FLAG,pcse1_0.USER_SESSION_ID,pcse1_0.DATA,pcse1_0.TIMESTAMP,pcse1_0.version from OFFLINE_CLIENT_SESSION pcse1_0 where ((pcse1_0.CLIENT_ID=? and pcse1_0.CLIENT_STORAGE_PROVIDER=? and pcse1_0.EXTERNAL_CLIENT_ID=? and pcse1_0.OFFLINE_FLAG=? and pcse1_0.USER_SESSION_ID=?))
Version
25.0.2
Regression
- The issue is a regression
Expected behavior
Entities with version field with correct casing for successful login on offline sessions
Actual behavior
Throws "For mode on this error consult the server log at the debug level"
But i forget to save the errors
How to Reproduce?
In my case i was on version 24.0.1 and updated to 24.0.2, using Microsoft SQL Server
Anything else?
No response