Bartosz Kolej
Bartosz Kolej

Reputation: 117

Keycloak email from gmail

I am trying setup Keycloak email with gmail. setup is easy, sample in this tutorial:

https://dev.to/rounakcodes/keycloak-configure-realm-email-settings-gmail-3dfn/

problem is with google settings, from May 30, 2022 google turn off Less secure apps what is necessary to connect gmail account with Keycloak (Keycloack is using only username and password to authorize gmail)

Maybe someone have idea how to workaround this problem? Same problem is with google workspace, right now it's working but They Are going to turn it off.

enter image description here

enter image description here

Upvotes: 4

Views: 5938

Answers (2)

Deepak N
Deepak N

Reputation: 1639

Since the less secure app feature is removed we have to follow these below steps to use Gmail via third party software that is App password

Step 1: setup 2-Step Verification:- Google Account -> Security -> 2-Step Verification -> Input password as asked -> Turn ON (you could use SMS to get Gmail code to activate 2-Step Verification)

Step 2: Generate app secret:- Google Account -> Security -> App password -> Input password as asked -> Select the app and device... -> e.g. Other(keycloak example) -> Input app name e.g. MyApp -> Generate

Step 3: Use generated app secret:- Copy a 16-character password Use a 16-character password (instead of actual password) with Gmail username in your application

This worked for me

Upvotes: 7

kramar
kramar

Reputation: 381

try to generate App password https://myaccount.google.com/apppasswords and use it as SMTP password in "Email" configuration. It works for me on local build

I've found an answer here - https://groups.google.com/g/keycloak-user/c/PPtjMHJKwG0

Upvotes: 6

Related Questions