Keycloak - request user to verify email address through api

Viewed 2189

Desired result:

User should be able to register and then he should be able to login thrugh a mobile app (event if the email address isn't verified), the app shows a warning that email isn't verified and some app functionality a disabled

What i have:

  1. native mobile app that has user signup and signin functionality
  2. api server consumed by the app
  3. keycloack instance

signup functionality is done by api server, it is a keycloak confidencial client that can create users signin is done by the mobile app directly with a post call to keycloak /token endpoind that returns access token

all good, now i have a token that can be consumed by my api server and i know that it is a registered user with unconfirmed email address

The problem is that user don't receive any Welcome/Confirm email, but: if user goes to keycloak LogIn webpage and try to login with newly created user then he receives an email from Keycloak, but for LogIn through api there are no emails. Is there any way so solve this? Am i doing something wrong?

The only way to request user to verify emails is by requesting "Verify Email" action, but if i do this then user can't login with unverified email anymore

Login is done with POST to /auth/realms/realm/protocol/openid-connect/token and with {grant_type: 'password', password: 'string', username: 'string'} body

Calling PUT /{realm}/users/{id}/send-verify-email seems to behaves the same like requesting Verify Email to /execute-actions-email

0 Answers
Related