Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown essential acr claim does not result in an error #8724

Closed
CorneliaLahnsteiner opened this issue Nov 8, 2021 · 0 comments · Fixed by #10088
Closed

Unknown essential acr claim does not result in an error #8724

CorneliaLahnsteiner opened this issue Nov 8, 2021 · 0 comments · Fixed by #10088
Assignees
Labels
area/authentication Indicates an issue on Authentication area area/oidc Indicates an issue on OIDC area kind/bug Categorizes a PR related to a bug
Milestone

Comments

@CorneliaLahnsteiner
Copy link
Contributor

CorneliaLahnsteiner commented Nov 8, 2021

Describe the bug

Just related to the Step up Authentication:

Currently, the behavior in the case of an unknown essential acr claim does not comply with the OIDC specification, which states:
If the acr claim is requested as an Essential Claim for the ID Token with a values parameter requesting specific Authentication Context Class Reference values and the implementation supports the claims parameter, the Authorization Server MUST return an acr Claim Value that matches one of the requested values. If this is an Essential Claim and the requirement cannot be met, then the Authorization Server MUST treat that outcome as a failed authentication attempt.

Behavior has been removed with the implementation of the callback: 6e4fb3a#diff-b72231a1d2641bd3ef2dfbe97433cda0a506e6c4fafa89896222339716cee6faL305

Version

17.0.0-SNAPSHOT

Expected behavior

The authentication process should result in an error page instead of an successful authentication.

Actual behavior

The authentication process results in an successful authentication.

How to Reproduce?

To reproduce the issue, send an authentication request with an essential request and an unknown or high (e.g. 5) acr value. After finishing the authentication (entering username/password and OTP), you should receive an authentication error. Instead, you are currently authenticating successfully with the highest authentication level.

Request example:
https://{DOMAIN}/auth/realms/{REALMNAME}/protocol/openid-connect/auth?client_id={CLIENT-ID}&redirect_uri={REDIRECT-URI}&scope=openid&response_type=code&response_mode=query&nonce=exg16fxdjcu&claims=%7B%22id_token%22%3A%7B%22acr%22%3A%7B%22essential%22%3Atrue%2C%22values%22%3A%5B%22unkownvalue%22%5D%7D%7D%7D

Anything else?

Tests for this use case are already commited:

  • LevelOfAssuranceTest.java:stepupToUnknownEssentialAcrFails
  • LevelOfAssuranceTest.java:essentialClaimNotReachedFails
  • LevelOfAssuranceTest.java:essentialUnknownClaimFail

Related issue

There is another issue related to the ACR that under some circumstances, the ACR level is not correctly updated in the authentication session after finish of subflow with the ACR condition. This is possible to seen in the LevelOfAssuranceTest.stepupAuthentication() , which requires authentication to level 3 (push the button) in case that only the level 2 (gold) was requested.

@CorneliaLahnsteiner CorneliaLahnsteiner added the kind/bug Categorizes a PR related to a bug label Nov 8, 2021
@stianst stianst added area/oidc Indicates an issue on OIDC area status/triage labels Nov 8, 2021
mposolda added a commit to mposolda/keycloak that referenced this issue Feb 9, 2022
…t acr is set after authentication flow during step-up authentication

Closes keycloak#8724
Co-authored-by: Cornelia Lahnsteiner <cornelia.lahnsteiner@prime-sign.com>
mposolda added a commit to mposolda/keycloak that referenced this issue Feb 9, 2022
…t acr is set after authentication flow during step-up authentication

Closes keycloak#8724
Co-authored-by: cornelia.lahnsteiner@prime-sign.com
mposolda added a commit to mposolda/keycloak that referenced this issue Feb 9, 2022
…t acr is set after authentication flow during step-up authentication

Closes keycloak#8724

Co-authored-by: cornelia.lahnsteiner@prime-sign.com
mposolda added a commit to mposolda/keycloak that referenced this issue Feb 9, 2022
…t acr is set after authentication flow during step-up authentication

Closes keycloak#8724

Co-authored-by: cornelia.lahnsteiner@prime-sign.com
mposolda added a commit to mposolda/keycloak that referenced this issue Feb 9, 2022
…t acr is set after authentication flow during step-up authentication

Closes keycloak#8724

Co-authored-by: Cornelia Lahnsteiner <cornelia.lahnsteiner@prime-sign.com>
@mposolda mposolda added area/authentication Indicates an issue on Authentication area and removed status/triage labels Feb 9, 2022
@mposolda mposolda self-assigned this Feb 11, 2022
mposolda added a commit that referenced this issue Feb 15, 2022
#10088)

* Show error in case of an unkown essential acr claim. Make sure correct acr is set after authentication flow during step-up authentication
Closes #8724

Co-authored-by: Cornelia Lahnsteiner <cornelia.lahnsteiner@prime-sign.com>
Co-authored-by: Martin Bartoš <mabartos@redhat.com>
@mposolda mposolda added this to the 18.0.0 milestone Feb 15, 2022
@stianst stianst modified the milestones: 18.0.0, 17.1.0 Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/authentication Indicates an issue on Authentication area area/oidc Indicates an issue on OIDC area kind/bug Categorizes a PR related to a bug
Projects
None yet
3 participants