Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Client Session Max set never expires is not working anymore since 22.0.0 #21927

@johgoe

Description

@johgoe

Before reporting an issue

Area

oidc

Describe the bug

A standard

{"error":"invalid_grant","error_description":"User session not found"}

Version

22.0.1

Expected behavior

The user is able to login to the session as usual

Actual behavior

The login is not succesful. There always occurs a CODE_TO_TOKEN_ERROR with the following response

{"error":"invalid_grant","error_description":"User session not found"}

How to Reproduce?

Configure a client to "Client Session Max" = "never expires" in the Advance Settings

grafik

Try to login with this client for a webui

Anything else?

I'm not sure but I think the problem happens in SessionExpirationUtils.calculateClientSessionMaxLifespanTimestamp

In case of "Never expires" clientSessionMaxLifespanPerClient will be -1 after this line.

String clientSessionMaxLifespanPerClient = client == null? null : client.getAttribute(OIDCConfigAttributes.CLIENT_SESSION_MAX_LIFESPAN);

I think it was introduced with

https://github.com/keycloak/keycloak/pull/17525/files

Metadata

Metadata

Assignees

Labels

area/oidcIndicates an issue on OIDC areakind/bugCategorizes a PR related to a bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions