User email and password to log in to the app instead of username and password

Hello. With my current approach, i am creating users and generating the random username with keycloak admin rest api, users also include email in the form when they create an entry in our application. Now what i want to do is anytime someone creates an user account, i want it to be available to be logged in with email password instead of username and password. i could not find the relevant rest api endpoint that will create users with email login potential.

Thank you in advance!

It’s not about some REST endpoint, it’s about login settings in realm config:

Thank you for the reply!
In order this setting to be effective, shall i add any extra prop to the body when i create the user ? Or any user created in keycloak will be able to login with email if these options are on from the realm config ?

As mentioned, it’s a REALM setting, not related to individual user configs.

Sure, i got it, just asked because when i changed the settings, my Post request broke :smiley: So i thought i had to add some prop to it. I will try to figure out why it happened! THank you!