1 - Implement Password Reset UI
Implement an UI for Initiating password reset via Email.
2 - Configure Reset URLs
For security reasons, we only allow you to use redirect URL preconfigured with Streambird to ensure that we send emails to your users ONLY containingredirect_urls
you whitelisted with us.
3 - Initiate Reset Email
Each user must be stored on Streambird Auth, so we recommend ensuring that you store our auto generated User ID from the response into your database/backend in a column or field against that user (as long as you can associate your user with the auto generated ID returned by Streambird). We will ensure that each email is ONLY attached to a single user at any time. We will be using theLoginOrCreateUserViaMagicLink
, if a user is found with the provided email, it will be returned and magic link email sent out, otherwise, a new user will be created on the fly (aka JIT, Just in time).
cURL
4 - Verify Magic Link
In the previous step, your user will receive an email containing themagic_link
they can click on (the magic_link
has the redirect_url
you specified combined with the token
. This will then redirect the user to your app with the token
in the Query parameters. A sample link is shown below,
ApiKey
with VerifyMagicLink
endpoint.
cURL
user_id
of the user who owns the token (example response below)
JSON
user_id
with your users in your app, you are now done and you can safely authenticate the user!
However, if you have not previously attached the user_id
to your users table for example, you can also use our GetIdentityUser
endpoint to retrieve the emails
and phone_numbers
attached to the user using the user_id
returned by VerifyMagicLink
endpoint.
cURL
JSON