Repository navigation
A 'quick' question from a newbie about: Per-application MFA enforcement #27142
|
Hi everyone, I'm new to authentik and currently trying to migrate over from Authelia. First off, a huge thank you to all the developers and contributors - authentik is truly a fantastic piece of software! Overall, I've been very happy with Authelia, but having a proper web UI to manage users without needing to SSH into the server to edit config files is a massive quality-of-life improvement. Environment & SetupThe initial system setup went smoothly without issues:
The Problem / Use CaseI stumbled across an issue regarding per-application MFA requirements:
Observed behavior: I tried using an AI-suggested custom policy named # Check if a second factor was already used in the current session
return not request.user.has_usable_mfa_devices() or not request.http_request.session.get('authentik_mfa_authenticated', False)Unfortunately, this did not work as expected. Question
Thanks in advance for any insights! |
Replies: 1 comment
|
Hi @j-wit! The login to For applications behind a provider, put the extra MFA check in that provider's authorization flow. Add an Authenticator Validation stage, with Not configured action set to Deny or Configure if MFA is required. Skip would let users without a compatible authenticator continue. The built-in authentik UI is a separate case. In 2026.8.5, With this shared-session setup, keep MFA mandatory on every authentication path available to the admin account. If |
Hi @j-wit! The login to
project1creates an authentik session that the authentik UI can reuse. A policy ondefault-authentication-flowonly applies when that flow runs, it doesn't add an MFA check when an existing session opens the UI.For applications behind a provider, put the extra MFA check in that provider's authorization flow. Add an Authenticator Validation stage, with Not configured action set to Deny or Configure if MFA is required. Skip would let users without a compatible authenticator continue.
The built-in authentik UI is a separate case. In 2026.8.5,
/if/admin/is served directly, rather than through an application's provider authorization flow. So that per-provider recipe d…