Auth0 Home Blog Docs

How to redirect to form to get email for social login?

lock

#1

Using Lock v11, need to collect email address of user as well as post code which are mandatory as per requirement. But login via social does not provide email for Facebook or twitter. How to redirect to a form if user chooses to login / signup via social and collect ask them to fill email and post code if they have not provided?


#3

:wave: @smarajitdasgupta social connections like Facebook or Twitter do not send the user’s email by default.

For Twitter, first ensure you have set the correct twitter consumer key and twitter secret in your Twitter social connect in the Auth0 Dashboard. Then add the Get email address from Twitter Rule. You can find it in your dashboard User Rules > Create New Rule > Enrich Profile > Get email address from Twitter. Enable the rule for your application.

For Facebook, please be aware not all Facebook accounts have an email address. Some users may have signed up using their phone number. For those that do have, you’ll need to check the email scope in the Facebook settings under social connections in the Auth0 Dashboard. Also do note I believe users have the option to opt out of the permission to share their email address with your application.


#4