Capturing Additional Data using Social Login

Hello community, I am new to using Auth0 universal login and I am having trouble finding up to date information on how to capture additional data when a user uses a social provider to login.

I have seen similar questions but nothing exactly what I’m looking for/or they are out of date. Forgive me for any duplicate questions.

Currently I am not capturing email/password combinations, only data provided by the social provider; however, I would like to be able to have the user create a unique username if they are joining for the first time. This way I can consume that data at the app level going forward.
Because I don’t store email/password combinations, there is no fields available to manipulate in the widget to capture a username.

Being new to this, I might just be lost as to what the right approach is? So if you would be so kind:

What is the right approach to accomplish capturing the username and storing that with the social login provider if the account does not exist in my Auth0 users database already?
Thank you in advance !

Hi @11ty,

Welcome to the Auth0 Community!

To capture additional data from your users who use a social provider to log in, I recommend using a post-login action to redirect them to another page where they can set their username.

Once that is done, pass that information back to the Action to store it as the user_metadata.

Remember that you should do this only once, when they initially sign up and log in.

Please refer to our Redirect with Actions documentation for more details.

Let me know if you have any questions.

Thanks,
Rueben

Thank you @rueben.tiow for the quick reply! I want to echo back what I think I understand about the workflow using actions. Please comment on what might I need further understanding with.

  • First I am to create the post login action where I do a redirect to a form to gather more user information. Can this be within the Auth0 domain using universal login designer? Or, would that be from my application calling Auth0? (again I am just learning about Auth0’s capabilities)
  • Next the data is returned using the app metadata api along with the state
  • If the data is as expected the workflow continues again back to the original redirect

I have used one of the samples from here I hope I am on the right track. I would like to capture the username for new users without jumping back and forth between Auth0 and my application but IDK if this is possible to do all in Auth0. Please let me know if there are any other specific examples I could make use of to help me implement a solution. Thank you!

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