Repository navigation
Does Keycloak v26.2.x step-up flow with AuthenticationFlowSelectorExecutor and ACRCondition work correctly with separate ACR to LOA flows? #39801
Unanswered
samuli-rukkila
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm in a process of enabling step-up authentication to our Keycloak instance. In our case, we'll have following ACRs (to LOAs) present:
Keycloak documentation states that:
In our case, if user authenticates via Signicat (strong authentication), other auth methods shouldn't be executed at all.
Seems like in keycloak 26.2.0 they released the Dynamic Authentication Flow selection using Client Policies -feature which looks like it should handle our case too.
Current implementation
For the first two LOAs, the flow is quite simple:
Then for the 3rd LOA, I have then created a new client policy, which forwards requests with
acr=strongto a separate flow.Client policy:
[ { "name": "acr-eid-policy", "description": "When requesting acr=strong (LOA 3), this policy is triggered", "enabled": true, "conditions": [ { "condition": "acr-condition", "configuration": { "acr-property": "strong" } } ], "profiles": [ "eid-acr-to-signicat-pic" ], "global": false } ]Client profile:
{ "name": "eid-acr-to-signicat-pic", "description": "Client profile to forward authorize requests with acr=strong to Signicat identity provider (personal identifier code -variant)", "executors": [ { "executor": "auth-flow-enforcer", "configuration": { "auth-flow-alias": "signicat-loa3-flow", "auth-flow-loa": null } } ], "global": false }The
signicat-loa3-flowis quite simple, it fowards user to Signicat external IDP:Lastly, the Signicat has post-login flow like this:
The actual problem (and the workaround)
Seems like the biggest problem is that the main authentication flow doesn't include LOA 3 step-flow. In this case if user first authenticates via Signicat (
acr=strong) and application only asks for a lower auth (acr=mfafor example), user will be forwarded to the normal browser flow and will be asked for BOTH email + password and SMS MFA, even though user LOA is higher.This seems to be because the
AcrStore.javatries to find the LOA 3 in the main browser flow and since it's not found from that flow, Keycloak sets themaxAgeto 0, effectively making the auth process start again:Is this how it should work, have I misunderstood this new feature incorrectly?
Current workaround
For the current workaround, I have added a disabled 3rd LOA flow in the main browser flow, like this:
With this, its possible to first authenticate via Signicat (and get
acr=strong) and then user lower level LOAs.All reactions