Skip to content

Add Email OTP two-factor authentication via Required Action#89

Open
ckyvra wants to merge 2 commits intomesutpiskin:mainfrom
ckyvra:feat/enable-2fa
Open

Add Email OTP two-factor authentication via Required Action#89
ckyvra wants to merge 2 commits intomesutpiskin:mainfrom
ckyvra:feat/enable-2fa

Conversation

@ckyvra
Copy link
Contributor

@ckyvra ckyvra commented Dec 12, 2025

Inspired by the keycloak-mfa-plugins project, this commit introduces a new Required Action that enables Email OTP authentication through a dedicated credential provider.

Key changes:

  • Added a new "Email OTP" Required Action to validate and store the user's email in a credential attribute (similar to how SMS OTP works).
  • The email authentication option now appears in the Account Console under Security > Sign-in > Two-factor authentication.
  • Reused and adapted relevant code from keycloak-mfa-plugins/sms-authenticator.
  • Added a configuration flag to enforce mandatory 2FA.
  • Updated README.md with the complete workflow and deployment steps.
  • Added documentation note: the "Email OTP" action must be registered in Authentication > Required Actions (and enabled by default if desired).

This brings feature parity between SMS and Email OTP while keeping the same user experience and credential storage model.

Inspired by the keycloak-mfa-plugins project, this commit introduces a new Required Action that enables Email OTP authentication through a dedicated credential provider.

Key changes:
- Added a new "Email OTP" Required Action to validate and store the user's email in a credential attribute (similar to how SMS OTP works).
- The email authentication option now appears in the Account Console under Security > Sign-in > Two-factor authentication.
- Reused and adapted relevant code from keycloak-mfa-plugins/sms-authenticator.
- Added a configuration flag to enforce mandatory 2FA.
- Updated README.md with the complete workflow and deployment steps.
- Added documentation note: the "Email OTP" action must be registered in Authentication > Required Actions (and enabled by default if desired).

This brings feature parity between SMS and Email OTP while keeping the same user experience and credential storage model.
@mesutpiskin
Copy link
Owner

Hi @ckyvra

Thanks a lot for your contribution — great work, much appreciated 👍

I should mention that I’ve done a significant refactoring in the project recently. During that time I couldn’t push regular updates, sorry about that. Because of this, trying to merge your changes now results in quite a lot of conflicts.

Would you mind updating your changes according to the current structure and sending them again? That would make the merge process much smoother.

Thanks again for the effort and contribution 🙏

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.

2 participants