send_email_through_keyclock
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| send_email_through_keyclock [2026/03/09 07:32] – sonali | send_email_through_keyclock [2026/03/09 08:00] (current) – sonali | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | < | ||
| + | |||
| + | A system where users can log in using their **email Id /Username + Email OTP** instead of username/ | ||
| + | |||
| + | **Make Email OTP Java SPI ** | ||
| + | |||
| # Run this to find the Keycloak container: | # Run this to find the Keycloak container: | ||
| Line 34: | Line 40: | ||
| **3. Run build inside the container (registers the provider)** | **3. Run build inside the container (registers the provider)** | ||
| + | < | ||
| + | # Verify it's there | ||
| + | docker exec keycloak_app ls / | ||
| + | |||
| + | </ | ||
| + | |||
| < | < | ||
| docker exec keycloak_app / | docker exec keycloak_app / | ||
| Line 49: | Line 61: | ||
| **1. First configure SMTP (if not already done)** | **1. First configure SMTP (if not already done)** | ||
| - | Realm Settings → \Email Host: smtp.gmail.com, | + | Realm Settings → Email |
| + | |||
| + | Host: smtp.gmail.com, | ||
| + | |||
| + | Port: 587 | ||
| + | |||
| + | From: from email id | ||
| + | |||
| + | Username: your username, | ||
| + | |||
| + | Password: your app | ||
| + | |||
| + | password Enable StartTLS → Save → Test connection | ||
| **2. Create Email OTP Authentication Flow** | **2. Create Email OTP Authentication Flow** | ||
| + | < | ||
| - | Go to Authentication → Flows → Create flow Name: Browser Email OTP → \Save Add step → Username Password Form → \Required Add step → Email OTP → Required | + | Go to Authentication → Flows → Create flow Name: Browser Email OTP |
| + | → Save Add step → Username Password Form → Required Add step → | ||
| + | Email OTP → Required | ||
| + | |||
| + | </ | ||
| **3. Bind the flow** | **3. Bind the flow** | ||
| Line 62: | Line 91: | ||
| < | < | ||
| python3 -c " | python3 -c " | ||
| + | |||
| </ | </ | ||
| - | # check current email template | + | # check current email template |
| < | < | ||
| - | print(z.read(' | + | python3 -c " |
| + | import zipfile | ||
| + | with zipfile.ZipFile(' | ||
| + | | ||
| + | " | ||
| </ | </ | ||
| Line 128: | Line 162: | ||
| </ | </ | ||
| - | # Browser email otp Flow order should be\\ | + | **# Browser email otp Flow order should be** \\ |
| Username Form → Required (first)\\ | Username Form → Required (first)\\ | ||
| Email OTP Form → Required (second) | Email OTP Form → Required (second) | ||
| - | # Dont do this | + | **# Dont do this** |
| - No required user action available in user details\\ | - No required user action available in user details\\ | ||
send_email_through_keyclock.1773041545.txt.gz · Last modified: by sonali
