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.
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:
- display forms to the user for entering their email address and/or phone number;
- after filling in the forms, send the user a code or a link to confirm the entered information;
- 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:
- Open your project in Publisher Account and go to the Login section.
- Click Configure in the pane of a Login project.
- Go to the Authentication block and select the Miscellaneous data form section.
- If you want your Login project to display a form where the user can specify their email address:
- Set the Collect user email address toggle to On.
- Select an email address confirmation method: By code or By code and link.
- To require users to provide their email address, set the Require user to complete email form toggle to On.
- 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.
- To require users to provide their phone number, set the Require user to complete phone number toggle to On.
- 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:
- When using the
Auth via social network call with a JWT standard, add thefields=email
parameter.
Example of the request:
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'
- When using the
Auth via social network call with an OAuth 2.0 protocol, add thescope=email
parameter.
Example of the request:
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'
Found a typo or other text error? Select the text and press Ctrl+Enter.