I have an application, and users are created by API calls. The user information contains username, email, password etc. But is there any option to add the different user with same email id?
For example,
User 1 - Username- abc1, email - abc@gmail.com,password - … etc.
User 2 - Username- abc2, email - abc@gmail.com,password - … etc.
And also I want to send reset password email to abc@gmail.com. How can I do it?
You cannot have two users with the same email address in the same database for the exact reason you mention: Auth0 would have no way of knowing what user the password reset would be for.
Yes, but this would require some coding off your own.
The Management API allows you to request a Password Reset ticket. This is not the same as sending the reset email. The ticket is just the URL users need to visit to reset their password. So, here’s what you could do:
Have a page where users enter their usernames
Query the Management API for that user, get their secondary email
Request a Password Reset ticket for that user ID
Send a custom email to the secondary email
Sending that email doesn’t have to be hard, either. For our Auth0 deployment, we use SendGrid. They also provide a way to call their API and send an email with a predefined template (so you only have to send the email and ticket URL to the API). I’m sure other email providers allow you to do something similar.
You can use user_metadata or app_metadata, depending on if you want the user to be able to easily edit the field. Those two fields are regular JSON objects, so you can store anything you want in there.