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

Skip to content

Only first kerberos provider is checked #22352

@ullgren

Description

@ullgren

Before reporting an issue

Area

authentication

Describe the bug

When two or more Kerberos providers are added to the same realm the client provided token is only validated towards the first kerberos provider.. If the client provides a token issued by the second Kerberos provider they are not able to login.

The problem seems to be in org.keycloak.storage.UserStorageManager#getUserByCredential that fails completely on the first failure. It should instead continue to authenticate towards the next storage provider, if there are any.

Version

22.0.1

Expected behavior

Each Kerberos storage provider should be checked in the order specified by priority until one is successful or there are no more providers are available.

Actual behavior

Only the first Kerberos provider is actually checked.

How to Reproduce?

Setup a keycloak realm with two kerberos providers, test to login to the "Account Manager" with a token issued by the kerberos kdc defined in the provider with the least priority.

A demo using "docker compose" to setup a test environment together with a detailed guide on how to reproduce this bug can be found here https://github.com/ullgren/keycloak-with-two-kdc

Anything else?

Proposed patch will be submitted as a PR shortly.

Metadata

Metadata

Assignees

Labels

area/authenticationIndicates an issue on Authentication 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