mesutpiskin / keycloak-2fa-email-authenticator

🔒 Keycloak Authentication Provider implementation to get a two factor authentication with a OTP/code/token send via Email (through SMTP)

Home Page:https://medium.com/@mesutpiskin/two-factor-authentication-via-email-in-keycloak-custom-auth-spi-935bbb3952a8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using Keycloak 22.0.1 version folder missing

abhi8054 opened this issue · comments

using quay.io/keycloak/keycloak docker image

But how do I need to perform these steps :

html/code-email.ftl is a html email template. Copy to themes/base/email/html/

copy text/code-email.ftl to themes/base/email/text/

append messages/*.properties to themes/base/email/messages/messages_en.properties

But thers is only themes folder is available base/email/html or base/email/text subfolder is not available.

Please any one guide me. Thankyou.

using quay.io/keycloak/keycloak docker image

But how do I need to perform these steps :

html/code-email.ftl is a html email template. Copy to themes/base/email/html/

copy text/code-email.ftl to themes/base/email/text/

append messages/*.properties to themes/base/email/messages/messages_en.properties

But thers is only themes folder is available base/email/html or base/email/text subfolder is not available.

Please any one guide me. Thankyou.

you can manually create those folders. i am using 22.0.1 too and there was only themes folder. so i created folder inside that as suggested and it worked.

I have followed all the steps. However, when I run the server and login it still shows the authenticator screen for Microsoft and google. What steps you have followed to run it correctly?

I have followed all the steps. However, when I run the server and login it still shows the authenticator screen for Microsoft and google. What steps you have followed to run it correctly?

to confirm that you have followed all steps correctly, please upload your code somewhere because debugging it without checking the structure and code will be tough.

I have followed these steps:

  1. Created Jar file and placed it in the providers folder
  2. html/code-email.ftl is a html email template. Copy to themes/base/email/html/
  3. copy text/code-email.ftl to themes/base/email/text/
  4. append messages/*.properties to themes/base/email/messages/messages_en.properties
  5. ./kc.bat build to build it
  6. ./kc.bat start-dev to start the server.
  7. Modified authentication flow it looks like this
    image (3)

I have followed these steps:

  1. Created Jar file and placed it in the providers folder
  2. html/code-email.ftl is a html email template. Copy to themes/base/email/html/
  3. copy text/code-email.ftl to themes/base/email/text/
  4. append messages/*.properties to themes/base/email/messages/messages_en.properties
  5. ./kc.bat build to build it
  6. ./kc.bat start-dev to start the server.
  7. Modified authentication flow it looks like this
    image (3)

there should be Email option in "Add step" . you need to add that.

I have resolved it however, I am not able to get the OTP on the email. The server logs are as below. Although, I have copied all three files in their respective folders.
Caused by: org.keycloak.theme.FreeMarkerException: Failed to process template text/code-email.ftl
at org.keycloak.theme.freemarker.DefaultFreeMarkerProvider.processTemplate(DefaultFreeMarkerProvider.java:52)
at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.processTemplate(FreeMarkerEmailTemplateProvider.java:228)