8000 Make UserStorageManager check all applicable CredentialAuthenticators by ullgren · Pull Request #22353 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Make UserStorageManager check all applicable CredentialAuthenticators - #22353

Closed
ullgren wants to merge 1 commit into
keycloak:mainfrom
Redpill-Linpro:fix-for-two-kerberos-kdc
Closed

ullgren wants to merge 1 commit into
keycloak:mainfrom
Redpill-Linpro:fix-for-two-kerberos-kdc

Conversation

@ullgren
@ullgren ullgren commented Aug 9, 2023
Copy link
Copy Markdown
  • getUserByCredential will now iterate through all applicable CredentialAuthenticators. Returns response early, if the output from the authenticate call indicates the user is authenticated. Otherwise, will return the last failed output. Returns null if none of the CredentialAuthenticators provide a non-null response

Fixes #22352

 - getUserByCredential will now iterate through all applicable
   CredentialAuthenticators. Returns response early, if the output from
   the authenticate call indicates the user is authenticated.
   Otherwise, will return the last failed output. Returns null if none
   of the CredentialAuthenticators provide a non-null response

Fixes keycloak#22352
@ullgren
ullgren requested a review from a team August 9, 2023 23:09
@ullgren
ullgren requested a review from a team as a code owner August 9, 2023 23:09
@ghost ghost added the team/store label Aug 9, 2023
@ahus1
ahus1 commented Aug 11, 2023
Copy link
Copy Markdown
Member

Thank you for contributing this PR. I had a look and I see that it changes the behavior to ask multiple authenticators for their response, and iterates of them.

This is actually an aggregation of CredentialValidationOutputs which is done here, and looking at that class the merge() hasn't been implemented yet.

While this will probably work in the scenario described here, I see the problem that one provider denies the request, and then a second approves it. Should the deny take precedence? This leads to a lot of questions for me.

With the current CredentialValidationOutput we don't have an option of an indifferent response. While one could be added, I'd rather enhance the credentialAuthentication.supportsCredentialAuthenticationFor(input.getType())) call by some additional context. If the CredentialInput would be passed to this method as well, would the provider then be able to determine if they should handle it by just looking at the SPNEGO token?

As this is going more in the direction on how credential authentication should work, I'm assigning this to the core team, cc: @mposolda.

@mposolda mposolda self-assigned this Aug 15, 2023
@mposolda
Copy link
Copy Markdown
Contributor

@ullgren Thanks for the PR. I am closing it for now as I've sent another one #22531, which adds automated tests and some more flexibility. Feel free to test that one please if you have a chance and comment/review if it looks good to you.

@mposolda mposolda closed this Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only first kerberos provider is checked

4 participants

0