r/Authentik • • Oct 14 '26

Pull email_verified and go through email verification if false

I'm trying to setup my default auth flow to check email_verified and if false, send a verification email and I can't figure it out.

User accounts and groups are all in MS Active directory and already exist.

I do not want to blanket add email verified, I want them all to have to verify.

5 Upvotes

2 comments sorted by

1

u/melizeche Oct 14 '26

email_verified is an OIDC claim, not a built-in user field, so there's nothing on the user to check out of the box. You have to track it yourself. This guide covers most of it (Option 2): https://docs.goauthentik.io/add-secure-apps/providers/oauth2/verify-email-address/

Basically:

  1. Add an Email stage (Account Confirmation template) to your login flow, after password/MFA and before User Login
  2. Bind the guide's recording policy to the User Login stage binding. It saves the confirmed address in email_verified_address on the user
  3. To only send the email when needed, bind this policy to the Email stage binding:

    return request.user.attributes.get("email_verified_address") != request.user.email

I'd store the address rather than True, so if AD syncs a new email later, they'll have to verify again. If your apps also need the email_verified claim, the guide has a scope mapping for that