How to support changing login email with Google SSO

I am using Auth0 as the authentication provider for my app, and now I want to support the feature that allows users to change their login email.

My application currently supports two authentication schema: Auth0 Username+password and google SSO.

For updating the email when a user is using Auth0 Username+password, the path I need to take is quite clear . I can see the API to update the user’s email Auth0 Management API v2 and then trigger a verification email to be sent.

The problematic part is if the user who wants to switch to another email sign up using Google SSO.

From what I understand, it is not possible to use the Management API for this. So the question now is, how can changing of login email be implemented when authentication scheme used is SSO?

Hi @opedad

The account is not made using only the Google email address, but the whole Google account therefore you can’t change the email, you would need to change the entire account. What I would suggest would be linking the old and new Google account into a single Auth0 account, and deleting the old one as an identity.

If you have any other question for us feel free to reach out.

Have a good one,
Vlad

1 Like

Hi @vlad.murarasu

Can you maybe expand on this?

Specifically if this can be automated via API calls, and if so which API if you know?

Thanks!

Hi @opedad

For account linking, you will have to use the Management API. I’ll leave the docs for account linking here:

Have a good one,
Vlad

1 Like

You mentioned that:

What I would suggest would be linking the old and new Google account into a single Auth0 account, and deleting the old one as an identity.

From the linked docs I read:

  • If you delete the primary account, the secondary account is deleted as well

This breaks the use case I have where I want the original account to stop working.

I guess I am out of luck

You need to first make the new account the primary account, unlink the original account and then you will be able to delete it safely.

1 Like

I looked through the documentation and I am not sure this is possible

Yes, I apologize, I also looked more into it and it’s not possible.
There doesn’t seem to be any way of changing Google emails.

If you have any other questions feel free to ask.

Have a good one,
Vlad

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.