Collecting email addresses and phone numbers

How it works

The Login product automatically saves the contact information of users provided to your Login project when they register or log into your application. This information is stored in the Xsolla database and includes the user’s email address and phone number. In some cases, not all contact details may be passed, for example:

  • With the passwordless login option, only the contact details that were specified by the user to receive a one-time confirmation code are passed to your Login project, that is, only an email address or phone number.
  • When authorizing through a social network, its provider may not pass information about users’ email addresses.

You can additionally request missing contact details using the Login product and use them to:

  • export users’ emails to your Mailchimp account and add them to your newsletter list;
  • create a unique identifier for the user based on their email address or phone number.

Note
If you have integrated Xsolla Launcher, emails are collected automatically without any additional settings.

Who can use it

Partners who have already integrated Login, as well as configured the option to log into the application through social networks or use passwordless authorization.

How to get it

Depending on the integration option selected for your Login project, you can configure the collection of email addresses and phone numbers:

Collecting email addresses and phone numbers via Login widget v2.0

With Login widget v2.0, you can prompt users for their email addresses and/or phone numbers if this information was not provided:

  • when registering through social networks;
  • when entering the application with a one-time code (i.e., when using the passwordless authentication).

After you enable the request for email addresses and/or phone numbers in Publisher Account, your Login project will automatically:

  1. display forms to the user for entering their email address and/or phone number;
  2. after filling in the forms, send the user a code or a link to confirm the entered information;
  3. check the confirmation code and store the received information in the database.

You can make it mandatory for users to complete the forms.

To enable the collection of email addresses and phone numbers of users:

  1. Open your project in Publisher Account and go to the Login section.
  2. Click Configure in the pane of a Login project.
  3. Go to the Authentication block and select the Miscellaneous data form section.

  1. If you want your Login project to display a form where the user can specify their email address:
    1. Set the Collect user email address toggle to On.
    2. Select an email address confirmation method: By code or By code and link.
  2. To require users to provide their email address, set the Require user to complete email form toggle to On.
  3. If you want your Login project to display a form where the user can specify their phone number, set the Collect user phone number toggle to On.
Note
Phone number confirmation is always done with a code sent via SMS.
  1. To require users to provide their phone number, set the Require user to complete phone number toggle to On.
  2. If you have enabled both the email address collection form and the phone number collection form, select the order in which they will be displayed to the user in the drop-down list at the bottom of the page.

Collecting email addresses via Login API calls

With the Login API, you can prompt users for their email addresses if they were not provided when registering through social networks.

If you have integrated your Login project via Login API calls:

Example of the request:

Copy
Full screen
Small screen

http

  • http
  • curl
GET https://login.xsolla.com/api/social/{providerName}/login_redirect?projectId={projectId}&fields=email&login_url={login_url} HTTP/1.1
curl --request GET \
  --url 'https://login.xsolla.com/api/social/providerName/login_redirect?projectId=projectId&fields=email&login_url=login_url'

Example of the request:

Copy
Full screen
Small screen

http

  • http
  • curl
GET https://login.xsolla.com/api/oauth2/social/{providerName}/login_redirect?scope=email&client_id={client_id}&redirect_uri={redirect_uri}&state={state}&response_type=code HTTP/1.1
curl --request GET \
  --url 'https://login.xsolla.com/api/oauth2/social/provider_name/login_redirect?scope=email&client_id=client_id&redirect_uri=redirect_uri&state=state&response_type=code'
Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Rate this page
Rate this page
Is there anything we can improve?

Don’t want to answer

Thank you for your feedback!
Last updated: January 22, 2024

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!