Login API v2.0

Overview

The section describes methods for working with Login. Please set up your Login in Publisher Account before sending requests.

If the user data is stored on your side, use proxy requests.

Endpoint path: https://login.xsolla.com/api.

JWT Validation

A JWT signed by the secret key is generated for each successfully authenticated user. To make sure that the JWT has not expired and belongs to the user in your project, you need to validate its value.

To validate the JWT:

  1. Select the library and connect it to your server-side application.
  2. Copy the secret key value from your Publisher Account > Login settings > General settings > Secret key.
  3. Pass the secret key value to the validation function.

Notice: Do not share your secret key with anyone. Update the key if it has been compromised.

Authentication

Register User

Adds a new user to the database. The user will receive an account confirmation message to the specified email.

HTTP REQUEST

POST https://login.xsolla.com/api/user?projectId={projectId}&login_url={login_url}

Parameter Type Description
projectId
string Login ID from Publisher Account. Required.
login_url
string URL to generate the link with additional parameters and to redirect the user to after account confirmation. Must be identical to the Callback URL specified in Publisher Account in Login settings. Required if there are several Callback URLs.
username
string Username. Required.
password
string Password. Required.
email
string Email. Required.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
Request
POST https://login.xsolla.com/api/user?login_url=https://example.com&projectId={projectId}

Headers:
  Content-Type: application/json

Body:
  {
  "username": "John",
  "password": "password123",
  "email": "john-email@email.com"  
}
curl --request POST \
  --url 'https://login.xsolla.com/api/user?projectId={projectId}&login_url=https%3A%2F%2Fexample.com' \
  --header 'content-type: application/json' \
  --data '{"username":"John","password":"password123","email":"john-email@email.com"}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"username":"John","password":"password123","email":"john-email@email.com"}');

$request->setRequestUrl('https://login.xsolla.com/api/user');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString(array(
  'projectId' => '{projectId}',
  'login_url' => 'https://example.com'
)));

$request->setHeaders(array(
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://login.xsolla.com/api/user?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"username\":\"John\",\"password\":\"password123\",\"email\":\"john-email@email.com\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("login.xsolla.com")

payload = "{\"username\":\"John\",\"password\":\"password123\",\"email\":\"john-email@email.com\"}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/user?projectId={projectId}&login_url=https%3A%2F%2Fexample.com", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://login.xsolla.com/api/user?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"username\":\"John\",\"password\":\"password123\",\"email\":\"john-email@email.com\"}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"username\":\"John\",\"password\":\"password123\",\"email\":\"john-email@email.com\"}");
Request request = new Request.Builder()
  .url("https://login.xsolla.com/api/user?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "username": "John",
  "password": "password123",
  "email": "john-email@email.com"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://login.xsolla.com/api/user?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
Response

Authentication by Username and Password

Authenticates the user by the username and password specified.

Response: URL with the token and remember_me parameters to redirect the user to after successful authentication.

HTTP REQUEST

POST https://login.xsolla.com/api/login?projectId={projectId}&login_url={login_url}

Parameter Type Description
projectId
string Login ID from Publisher Account. Required.
login_url
string URL to generate the link with additional parameters and to redirect the user to after successful authentication. Must be identical to the Callback URL specified in Publisher Account in Login settings. Required if there are several Callback URLs.
username
string Username. Required.
password
string Password. Required.
remember_me
boolean Whether the user agrees to save the authentication data. Default is 'false'.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
Request
POST https://login.xsolla.com/api/login?login_url=https://example.com&projectId={projectId}

Headers:
  Content-Type: application/json

Body:
  {
  "username": "Jane",
  "password": "123456",
  "remember_me": true
}
curl --request POST \
  --url 'https://login.xsolla.com/api/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com' \
  --header 'content-type: application/json' \
  --data '{"username":"Jane","password":"123456","remember_me":true}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"username":"Jane","password":"123456","remember_me":true}');

$request->setRequestUrl('https://login.xsolla.com/api/login');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString(array(
  'projectId' => '{projectId}',
  'login_url' => 'https://example.com'
)));

$request->setHeaders(array(
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://login.xsolla.com/api/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"username\":\"Jane\",\"password\":\"123456\",\"remember_me\":true}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("login.xsolla.com")

payload = "{\"username\":\"Jane\",\"password\":\"123456\",\"remember_me\":true}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://login.xsolla.com/api/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"username\":\"Jane\",\"password\":\"123456\",\"remember_me\":true}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"username\":\"Jane\",\"password\":\"123456\",\"remember_me\":true}");
Request request = new Request.Builder()
  .url("https://login.xsolla.com/api/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "username": "Jane",
  "password": "123456",
  "remember_me": true
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://login.xsolla.com/api/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
Response
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg3NTcyODEsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4NjcwODgxLCJ1c2VybmFtZSI6IkphbmUiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InV0Nmt0alNNbDFja2ZKZVpLVkJJYlNuQTE5a1hWdDJwX1VGT1J2T2RlUjQiLCJzdWIiOiI2NjAwYTZhZS0yMmU2LTExZTktOTE0Yy00MjAxMGFhODAwMTciLCJlbWFpbCI6ImJvZ29mZUBvbmVjaXR5bWFpbC5jb20iLCJ0eXBlIjoieHNvbGxhX2xvZ2luIiwieHNvbGxhX2xvZ2luX3Byb2plY3RfaWQiOiI1MDkzYzliMy0xZDVlLTExZTktOTI0NC00MjAxMGFhODAwMDQiLCJwdWJsaXNoZXJfaWQiOjc5MDE3fQ.AZg1bPEZCNNd0oxskmwwoF6tKX3KXldX7uy_8a-jRZk&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg3NTcyODEsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4NjcwODgxLCJ1c2VybmFtZSI6IkphbmUiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InV0Nmt0alNNbDFja2ZKZVpLVkJJYlNuQTE5a1hWdDJwX1VGT1J2T2RlUjQiLCJzdWIiOiI2NjAwYTZhZS0yMmU2LTExZTktOTE0Yy00MjAxMGFhODAwMTciLCJlbWFpbCI6ImJvZ29mZUBvbmVjaXR5bWFpbC5jb20iLCJ0eXBlIjoieHNvbGxhX2xvZ2luIiwieHNvbGxhX2xvZ2luX3Byb2plY3RfaWQiOiI1MDkzYzliMy0xZDVlLTExZTktOTI0NC00MjAxMGFhODAwMDQiLCJwdWJsaXNoZXJfaWQiOjc5MDE3fQ.AZg1bPEZCNNd0oxskmwwoF6tKX3KXldX7uy_8a-jRZk&remember_me=true"
}
"login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg0MTE2NTcsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4MzI1MjU3LCJ1c2VybmFtZSI6ImdpbW9idSIsInhzb2xsYV9sb2dpbl9hY2Nlc3Nfa2V5IjoiLXIzQ1lZWHBkcGRrV3o0MUNuM1A2a1V4N1IwaDZneUlOSExqTE1zd2FScyIsInN1YiI6IjhhZmMzMTFlLTFkNjItMTFlOS05OWFkLTQyMDEwYWE4MDAyMSIsImVtYWlsIjoiZ2ltb2J1QG9uZWNpdHltYWlsLmNvbSIsInR5cGUiOiJ4c29sbGFfbG9naW4iLCJ4c29sbGFfbG9naW5fcHJvamVjdF9pZCI6IjUwOTNjOWIzLTFkNWUtMTFlOS05MjQ0LTQyMDEwYWE4MDAwNCIsInB1Ymxpc2hlcl9pZCI6NzkwMTd9.PgB_vMhzUuXYkf1FY0vaI8a3HzrH5R3G-I6t3PpH_bM&remember_me=true"
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg3NTcyODEsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4NjcwODgxLCJ1c2VybmFtZSI6IkphbmUiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InV0Nmt0alNNbDFja2ZKZVpLVkJJYlNuQTE5a1hWdDJwX1VGT1J2T2RlUjQiLCJzdWIiOiI2NjAwYTZhZS0yMmU2LTExZTktOTE0Yy00MjAxMGFhODAwMTciLCJlbWFpbCI6ImJvZ29mZUBvbmVjaXR5bWFpbC5jb20iLCJ0eXBlIjoieHNvbGxhX2xvZ2luIiwieHNvbGxhX2xvZ2luX3Byb2plY3RfaWQiOiI1MDkzYzliMy0xZDVlLTExZTktOTI0NC00MjAxMGFhODAwMDQiLCJwdWJsaXNoZXJfaWQiOjc5MDE3fQ.AZg1bPEZCNNd0oxskmwwoF6tKX3KXldX7uy_8a-jRZk&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg3NTcyODEsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4NjcwODgxLCJ1c2VybmFtZSI6IkphbmUiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InV0Nmt0alNNbDFja2ZKZVpLVkJJYlNuQTE5a1hWdDJwX1VGT1J2T2RlUjQiLCJzdWIiOiI2NjAwYTZhZS0yMmU2LTExZTktOTE0Yy00MjAxMGFhODAwMTciLCJlbWFpbCI6ImJvZ29mZUBvbmVjaXR5bWFpbC5jb20iLCJ0eXBlIjoieHNvbGxhX2xvZ2luIiwieHNvbGxhX2xvZ2luX3Byb2plY3RfaWQiOiI1MDkzYzliMy0xZDVlLTExZTktOTI0NC00MjAxMGFhODAwMDQiLCJwdWJsaXNoZXJfaWQiOjc5MDE3fQ.AZg1bPEZCNNd0oxskmwwoF6tKX3KXldX7uy_8a-jRZk&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg3NTcyODEsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4NjcwODgxLCJ1c2VybmFtZSI6IkphbmUiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InV0Nmt0alNNbDFja2ZKZVpLVkJJYlNuQTE5a1hWdDJwX1VGT1J2T2RlUjQiLCJzdWIiOiI2NjAwYTZhZS0yMmU2LTExZTktOTE0Yy00MjAxMGFhODAwMTciLCJlbWFpbCI6ImJvZ29mZUBvbmVjaXR5bWFpbC5jb20iLCJ0eXBlIjoieHNvbGxhX2xvZ2luIiwieHNvbGxhX2xvZ2luX3Byb2plY3RfaWQiOiI1MDkzYzliMy0xZDVlLTExZTktOTI0NC00MjAxMGFhODAwMDQiLCJwdWJsaXNoZXJfaWQiOjc5MDE3fQ.AZg1bPEZCNNd0oxskmwwoF6tKX3KXldX7uy_8a-jRZk&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg3NTcyODEsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4NjcwODgxLCJ1c2VybmFtZSI6IkphbmUiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InV0Nmt0alNNbDFja2ZKZVpLVkJJYlNuQTE5a1hWdDJwX1VGT1J2T2RlUjQiLCJzdWIiOiI2NjAwYTZhZS0yMmU2LTExZTktOTE0Yy00MjAxMGFhODAwMTciLCJlbWFpbCI6ImJvZ29mZUBvbmVjaXR5bWFpbC5jb20iLCJ0eXBlIjoieHNvbGxhX2xvZ2luIiwieHNvbGxhX2xvZ2luX3Byb2plY3RfaWQiOiI1MDkzYzliMy0xZDVlLTExZTktOTI0NC00MjAxMGFhODAwMDQiLCJwdWJsaXNoZXJfaWQiOjc5MDE3fQ.AZg1bPEZCNNd0oxskmwwoF6tKX3KXldX7uy_8a-jRZk&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg3NTcyODEsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4NjcwODgxLCJ1c2VybmFtZSI6IkphbmUiLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InV0Nmt0alNNbDFja2ZKZVpLVkJJYlNuQTE5a1hWdDJwX1VGT1J2T2RlUjQiLCJzdWIiOiI2NjAwYTZhZS0yMmU2LTExZTktOTE0Yy00MjAxMGFhODAwMTciLCJlbWFpbCI6ImJvZ29mZUBvbmVjaXR5bWFpbC5jb20iLCJ0eXBlIjoieHNvbGxhX2xvZ2luIiwieHNvbGxhX2xvZ2luX3Byb2plY3RfaWQiOiI1MDkzYzliMy0xZDVlLTExZTktOTI0NC00MjAxMGFhODAwMDQiLCJwdWJsaXNoZXJfaWQiOjc5MDE3fQ.AZg1bPEZCNNd0oxskmwwoF6tKX3KXldX7uy_8a-jRZk&remember_me=true"
}

Proxy Authentication

Proxy User Registration

Adds a new user to the database. Proxies the request to New user URL specified in Login settings in Publisher Account. The user will receive an email confirmation message to the specified email.

HTTP REQUEST

POST https://login.xsolla.com/api/proxy/registration?projectId={projectId}&login_url={login_url}

Parameter Type Description
projectId
string Login ID from Publisher Account. Required.
login_url
string URL to generate the link with additional parameters and to redirect the user to after email confirmation. Must be identical to the Callback URL specified in Publisher Account in Login settings. Required if there are several Callback URLs.
username
string Username. Required.
password
string Password. Required.
email
string Email. Required.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
Request
POST https://login.xsolla.com/api/proxy/registration?login_url=https://example.com&projectId={projectId}

Headers:
  Content-Type: application/json

Body:
  {
  "password": "password123",
  "username": "Mike",
  "email": "mike-email@email.com"
}
curl --request POST \
  --url 'https://login.xsolla.com/api/proxy/registration?projectId={projectId}&login_url=https%3A%2F%2Fexample.com' \
  --header 'content-type: application/json' \
  --data '{"username":"Mike","password":"password123","email":"mike-email@email.com"}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"username":"Mike","password":"password123","email":"mike-email@email.com"}');

$request->setRequestUrl('https://login.xsolla.com/api/proxy/registration');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString(array(
  'projectId' => '{projectId}',
  'login_url' => 'https://example.com'
)));

$request->setHeaders(array(
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://login.xsolla.com/api/proxy/registration?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"username\":\"Mike\",\"password\":\"password123\",\"email\":\"mike-email@email.com\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("login.xsolla.com")

payload = "{\"username\":\"Mike\",\"password\":\"password123\",\"email\":\"mike-email@email.com\"}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/proxy/registration?projectId={projectId}&login_url=https%3A%2F%2Fexample.com", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://login.xsolla.com/api/proxy/registration?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"username\":\"Mike\",\"password\":\"password123\",\"email\":\"mike-email@email.com\"}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"username\":\"Mike\",\"password\":\"password123\",\"email\":\"mike-email@email.com\"}");
Request request = new Request.Builder()
  .url("https://login.xsolla.com/api/proxy/registration?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "username": "Mike",
  "password": "password123",
  "email": "mike-email@email.com"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://login.xsolla.com/api/proxy/registration?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
Response

Proxy Authentication by Username and Password

Authenticates the user by the username and password specified. Proxies the request to User verification URL specified in Login settings in Publisher Account.

Response: URL with the token and remember_me parameters to redirect the user to after successful authentication.

HTTP REQUEST

POST https://login.xsolla.com/api/proxy/login?projectId={projectId}&login_url={login_url}

Parameter Type Description
projectId
string Login ID from Publisher Account. Required.
login_url
string URL to generate the link with additional parameters and to redirect the user to after successful authentication. Must be identical to the Callback URL specified in Publisher Account in Login settings. Required if there are several Callback URLs.
username
string Username. Required.
password
string Password. Required.
remember_me
boolean Whether the user agrees to save the authentication data. Default is 'false'.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
Request
POST https://login.xsolla.com/api/proxy/login?login_url=https://example.com&projectId={projectId}

Headers:
  Content-Type: application/json

Body:
  {
  "username": "John",
  "password": "123456",
  "remember_me": true
}
curl --request POST \
  --url 'https://login.xsolla.com/api/proxy/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com' \
  --header 'content-type: application/json' \
  --data '{"username":"John","password":"123456","remember_me":true}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"username":"John","password":"123456","remember_me":true}');

$request->setRequestUrl('https://login.xsolla.com/api/proxy/login');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString(array(
  'projectId' => '{projectId}',
  'login_url' => 'https://example.com'
)));

$request->setHeaders(array(
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://login.xsolla.com/api/proxy/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"username\":\"John\",\"password\":\"123456\",\"remember_me\":true}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("login.xsolla.com")

payload = "{\"username\":\"John\",\"password\":\"123456\",\"remember_me\":true}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/proxy/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://login.xsolla.com/api/proxy/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"username\":\"John\",\"password\":\"123456\",\"remember_me\":true}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"username\":\"John\",\"password\":\"123456\",\"remember_me\":true}");
Request request = new Request.Builder()
  .url("https://login.xsolla.com/api/proxy/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "username": "John",
  "password": "123456",
  "remember_me": true
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://login.xsolla.com/api/proxy/login?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
Response
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg0MjM5NDAsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4MzM3NTQwLCJ1c2VybmFtZSI6InJvc2F5ZW4iLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InBEdkdNa1VoWGFkX3lqYVZ3UElWNzZSdHpsMVUydXhCUnB5RUgtQmlmcTAiLCJzdWIiOiI4ZWUyYmU1ZS0xZDY5LTExZTktYWI1OS00MjAxMGFhODAwMjEiLCJ0eXBlIjoicHJveHkiLCJwcm92aWRlciI6Inhzb2xsYSIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiNTNkMjNhYzMtMWQ2Ni0xMWU5LTkyNDQtNDIwMTBhYTgwMDA0IiwiZW1haWwiOiJyb3NheWVuIiwicHVibGlzaGVyX2lkIjo3OTAxN30.NZxu3qDsLEuNV46TzIWw1eZS4Dznc7GPqGrVFeG1oCM&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg0MjM5NDAsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4MzM3NTQwLCJ1c2VybmFtZSI6InJvc2F5ZW4iLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InBEdkdNa1VoWGFkX3lqYVZ3UElWNzZSdHpsMVUydXhCUnB5RUgtQmlmcTAiLCJzdWIiOiI4ZWUyYmU1ZS0xZDY5LTExZTktYWI1OS00MjAxMGFhODAwMjEiLCJ0eXBlIjoicHJveHkiLCJwcm92aWRlciI6Inhzb2xsYSIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiNTNkMjNhYzMtMWQ2Ni0xMWU5LTkyNDQtNDIwMTBhYTgwMDA0IiwiZW1haWwiOiJyb3NheWVuIiwicHVibGlzaGVyX2lkIjo3OTAxN30.NZxu3qDsLEuNV46TzIWw1eZS4Dznc7GPqGrVFeG1oCM&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg0MjM5NDAsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4MzM3NTQwLCJ1c2VybmFtZSI6InJvc2F5ZW4iLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InBEdkdNa1VoWGFkX3lqYVZ3UElWNzZSdHpsMVUydXhCUnB5RUgtQmlmcTAiLCJzdWIiOiI4ZWUyYmU1ZS0xZDY5LTExZTktYWI1OS00MjAxMGFhODAwMjEiLCJ0eXBlIjoicHJveHkiLCJwcm92aWRlciI6Inhzb2xsYSIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiNTNkMjNhYzMtMWQ2Ni0xMWU5LTkyNDQtNDIwMTBhYTgwMDA0IiwiZW1haWwiOiJyb3NheWVuIiwicHVibGlzaGVyX2lkIjo3OTAxN30.NZxu3qDsLEuNV46TzIWw1eZS4Dznc7GPqGrVFeG1oCM&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg0MjM5NDAsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4MzM3NTQwLCJ1c2VybmFtZSI6InJvc2F5ZW4iLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InBEdkdNa1VoWGFkX3lqYVZ3UElWNzZSdHpsMVUydXhCUnB5RUgtQmlmcTAiLCJzdWIiOiI4ZWUyYmU1ZS0xZDY5LTExZTktYWI1OS00MjAxMGFhODAwMjEiLCJ0eXBlIjoicHJveHkiLCJwcm92aWRlciI6Inhzb2xsYSIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiNTNkMjNhYzMtMWQ2Ni0xMWU5LTkyNDQtNDIwMTBhYTgwMDA0IiwiZW1haWwiOiJyb3NheWVuIiwicHVibGlzaGVyX2lkIjo3OTAxN30.NZxu3qDsLEuNV46TzIWw1eZS4Dznc7GPqGrVFeG1oCM&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg0MjM5NDAsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4MzM3NTQwLCJ1c2VybmFtZSI6InJvc2F5ZW4iLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InBEdkdNa1VoWGFkX3lqYVZ3UElWNzZSdHpsMVUydXhCUnB5RUgtQmlmcTAiLCJzdWIiOiI4ZWUyYmU1ZS0xZDY5LTExZTktYWI1OS00MjAxMGFhODAwMjEiLCJ0eXBlIjoicHJveHkiLCJwcm92aWRlciI6Inhzb2xsYSIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiNTNkMjNhYzMtMWQ2Ni0xMWU5LTkyNDQtNDIwMTBhYTgwMDA0IiwiZW1haWwiOiJyb3NheWVuIiwicHVibGlzaGVyX2lkIjo3OTAxN30.NZxu3qDsLEuNV46TzIWw1eZS4Dznc7GPqGrVFeG1oCM&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg0MjM5NDAsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4MzM3NTQwLCJ1c2VybmFtZSI6InJvc2F5ZW4iLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InBEdkdNa1VoWGFkX3lqYVZ3UElWNzZSdHpsMVUydXhCUnB5RUgtQmlmcTAiLCJzdWIiOiI4ZWUyYmU1ZS0xZDY5LTExZTktYWI1OS00MjAxMGFhODAwMjEiLCJ0eXBlIjoicHJveHkiLCJwcm92aWRlciI6Inhzb2xsYSIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiNTNkMjNhYzMtMWQ2Ni0xMWU5LTkyNDQtNDIwMTBhYTgwMDA0IiwiZW1haWwiOiJyb3NheWVuIiwicHVibGlzaGVyX2lkIjo3OTAxN30.NZxu3qDsLEuNV46TzIWw1eZS4Dznc7GPqGrVFeG1oCM&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg0MjM5NDAsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4MzM3NTQwLCJ1c2VybmFtZSI6InJvc2F5ZW4iLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InBEdkdNa1VoWGFkX3lqYVZ3UElWNzZSdHpsMVUydXhCUnB5RUgtQmlmcTAiLCJzdWIiOiI4ZWUyYmU1ZS0xZDY5LTExZTktYWI1OS00MjAxMGFhODAwMjEiLCJ0eXBlIjoicHJveHkiLCJwcm92aWRlciI6Inhzb2xsYSIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiNTNkMjNhYzMtMWQ2Ni0xMWU5LTkyNDQtNDIwMTBhYTgwMDA0IiwiZW1haWwiOiJyb3NheWVuIiwicHVibGlzaGVyX2lkIjo3OTAxN30.NZxu3qDsLEuNV46TzIWw1eZS4Dznc7GPqGrVFeG1oCM&remember_me=true"
}
{
  "login_url": "https://example.com?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NDg0MjM5NDAsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi54c29sbGEuY29tIiwiaWF0IjoxNTQ4MzM3NTQwLCJ1c2VybmFtZSI6InJvc2F5ZW4iLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6InBEdkdNa1VoWGFkX3lqYVZ3UElWNzZSdHpsMVUydXhCUnB5RUgtQmlmcTAiLCJzdWIiOiI4ZWUyYmU1ZS0xZDY5LTExZTktYWI1OS00MjAxMGFhODAwMjEiLCJ0eXBlIjoicHJveHkiLCJwcm92aWRlciI6Inhzb2xsYSIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiNTNkMjNhYzMtMWQ2Ni0xMWU5LTkyNDQtNDIwMTBhYTgwMDA0IiwiZW1haWwiOiJyb3NheWVuIiwicHVibGlzaGVyX2lkIjo3OTAxN30.NZxu3qDsLEuNV46TzIWw1eZS4Dznc7GPqGrVFeG1oCM&remember_me=true"
}

Proxy User Password Reset

Resets the user's password. Proxies the request to Password reset URL specified in Login settings in Publisher Account.

HTTP REQUEST

POST https://login.xsolla.com/api/proxy/password/reset?projectId={projectId}&login_url={login_url}

Parameter Type Description
projectId
string Login ID from Publisher Account. Required.
login_url
string URL to generate the link with additional parameters and to redirect the user to after password reset confirmation. Must be identical to the Callback URL specified in Publisher Account in Login settings. Required if there are several Callback URLs.
email
string Email. Required.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
Request
POST https://login.xsolla.com/api/proxy/password/reset?login_url=https://example.com&projectId={projectId}

Headers:
  Content-Type: application/json

Body:
  {
  "email": "brooke-email@email.com"
}
curl --request POST \
  --url 'https://login.xsolla.com/api/proxy/password/reset?projectId={projectId}&login_url=https%3A%2F%2Fexample.com' \
  --header 'content-type: application/json' \
  --data '{"email":"brooke-email@email.com"}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"email":"brooke-email@email.com"}');

$request->setRequestUrl('https://login.xsolla.com/api/proxy/password/reset');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setQuery(new http\QueryString(array(
  'projectId' => '{projectId}',
  'login_url' => 'https://example.com'
)));

$request->setHeaders(array(
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://login.xsolla.com/api/proxy/password/reset?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"email\":\"brooke-email@email.com\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("login.xsolla.com")

payload = "{\"email\":\"brooke-email@email.com\"}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/api/proxy/password/reset?projectId={projectId}&login_url=https%3A%2F%2Fexample.com", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://login.xsolla.com/api/proxy/password/reset?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"email\":\"brooke-email@email.com\"}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"email\":\"brooke-email@email.com\"}");
Request request = new Request.Builder()
  .url("https://login.xsolla.com/api/proxy/password/reset?projectId={projectId}&login_url=https%3A%2F%2Fexample.com")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "email": "brooke-email@email.com"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://login.xsolla.com/api/proxy/password/reset?projectId={projectId}&login_url=https%3A%2F%2Fexample.com");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
Response

Social Authentication

Gets the links for authentication via all social networks, connected to Login in Publisher Account.

Response: URLs to use for social network buttons in login UI.

HTTP REQUEST

GET https://login.xsolla.com/api/social/login_urls?projectId={projectId}&fields={fields}&login_url={login_url}

Parameter Type Description
string Login ID from Publisher Account. Required.
array of strings List of parameters required for successful user registration/authentication. Example: 'email, promo_email_agreement'. The user will be asked to specify these parameters in the corresponding form.
string URL to generate the link for social network authentication. Must be identical to the Callback URL specified in Publisher Account in Login settings. Required if there are several Callback URLs.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
Request
GET https://login.xsolla.com/api/social/login_urls?fields=email&login_url=https://example.com&projectId={projectId}
curl --request GET \
  --url 'https://login.xsolla.com/api/social/login_urls?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://login.xsolla.com/api/social/login_urls');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString(array(
  'projectId' => '{projectId}',
  'fields' => 'email',
  'login_url' => 'https://example.com'
)));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://login.xsolla.com/api/social/login_urls?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("login.xsolla.com")

conn.request("GET", "/api/social/login_urls?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://login.xsolla.com/api/social/login_urls?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://login.xsolla.com/api/social/login_urls?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com")
  .get()
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://login.xsolla.com/api/social/login_urls?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com");

xhr.send(data);
Response
{
  "amazon": "https://example.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email",
  "baidu": "https://example.com/api/social/baidu/login_redirect?projectId={projectId}&fields=email",
  "battlenet": "https://example.com/api/social/battlenet/login_redirect?projectId={projectId}&fields=email",
  "china_telecom": "https://example.com/api/social/china_telecom/login_redirect?projectId={projectId}&fields=email",
  "discord": "https://example.com/api/social/discord/login_redirect?projectId={projectId}&fields=email",
  "facebook": "https://example.com/api/social/facebook/login_redirect?projectId={projectId}&fields=email",
  "github": "https://example.com/api/social/github/login_redirect?projectId={projectId}&fields=email",
  "google": "https://example.com/api/social/google/login_redirect?projectId={projectId}&fields=email",
  "google+": "https://example.com/api/social/google+/login_redirect?projectId={projectId}&fields=email",
  "instagram": "https://example.com/api/social/instagram/login_redirect?projectId={projectId}&fields=email",
  "kakao": "https://example.com/api/social/kakao/login_redirect?projectId={projectId}&fields=email",
  "linkedin": "https://example.com/api/social/linkedin/login_redirect?projectId={projectId}&fields=email",
  "mailru": "https://example.com/api/social/mailru/login_redirect?projectId={projectId}&fields=email",
  "microsoft": "https://example.com/api/social/microsoft/login_redirect?projectId={projectId}&fields=email",
  "msn": "https://example.com/api/social/msn/login_redirect?projectId={projectId}&fields=email",
  "naver": "https://example.com/api/social/naver/login_redirect?projectId={projectId}&fields=email",
  "ok": "https://example.com/api/social/ok/login_redirect?projectId={projectId}&fields=email",
  "paypal": "https://example.com/api/social/paypal/login_redirect?projectId={projectId}&fields=email",
  "pinterest": "https://example.com/api/social/pinterest/login_redirect?projectId={projectId}&fields=email",
  "qq": "https://example.com/api/social/qq/login_redirect?projectId={projectId}&fields=email",
  "reddit": "https://example.com/api/social/reddit/login_redirect?projectId={projectId}&fields=email",
  "steam": "https://example.com/api/social/steam/login_redirect?projectId={projectId}&fields=email",
  "twitch": "https://example.com/api/social/twitch/login_redirect?projectId={projectId}&fields=email",
  "twitter": "https://example.com/api/social/twitter/login_redirect?projectId={projectId}&fields=email",
  "vimeo": "https://example.com/api/social/vimeo/login_redirect?projectId={projectId}&fields=email",
  "vk": "https://example.com/api/social/vk/login_redirect?projectId={projectId}&fields=email",
  "wechat": "https://example.com/api/social/wechat/login_redirect?projectId={projectId}&fields=email",
  "weibo": "https://example.com/api/social/weibo/login_redirect?projectId={projectId}&fields=email",
  "yahoo": "https://example.com/api/social/yahoo/login_redirect?projectId={projectId}&fields=email",
  "yandex": "https://example.com/api/social/yandex/login_redirect?projectId={projectId}&fields=email",
  "youtube": "https://example.com/api/social/youtube/login_redirect?projectId={projectId}&fields=email"
}
{
  "amazon": "https://example.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email",
  "baidu": "https://example.com/api/social/baidu/login_redirect?projectId={projectId}&fields=email",
  "battlenet": "https://example.com/api/social/battlenet/login_redirect?projectId={projectId}&fields=email",
  "china_telecom": "https://example.com/api/social/china_telecom/login_redirect?projectId={projectId}&fields=email",
  "discord": "https://example.com/api/social/discord/login_redirect?projectId={projectId}&fields=email",
  "facebook": "https://example.com/api/social/facebook/login_redirect?projectId={projectId}&fields=email",
  "github": "https://example.com/api/social/github/login_redirect?projectId={projectId}&fields=email",
  "google": "https://example.com/api/social/google/login_redirect?projectId={projectId}&fields=email",
  "google+": "https://example.com/api/social/google+/login_redirect?projectId={projectId}&fields=email",
  "instagram": "https://example.com/api/social/instagram/login_redirect?projectId={projectId}&fields=email",
  "kakao": "https://example.com/api/social/kakao/login_redirect?projectId={projectId}&fields=email",
  "linkedin": "https://example.com/api/social/linkedin/login_redirect?projectId={projectId}&fields=email",
  "mailru": "https://example.com/api/social/mailru/login_redirect?projectId={projectId}&fields=email",
  "microsoft": "https://example.com/api/social/microsoft/login_redirect?projectId={projectId}&fields=email",
  "msn": "https://example.com/api/social/msn/login_redirect?projectId={projectId}&fields=email",
  "naver": "https://example.com/api/social/naver/login_redirect?projectId={projectId}&fields=email",
  "ok": "https://example.com/api/social/ok/login_redirect?projectId={projectId}&fields=email",
  "paypal": "https://example.com/api/social/paypal/login_redirect?projectId={projectId}&fields=email",
  "pinterest": "https://example.com/api/social/pinterest/login_redirect?projectId={projectId}&fields=email",
  "qq": "https://example.com/api/social/qq/login_redirect?projectId={projectId}&fields=email",
  "reddit": "https://example.com/api/social/reddit/login_redirect?projectId={projectId}&fields=email",
  "steam": "https://example.com/api/social/steam/login_redirect?projectId={projectId}&fields=email",
  "twitch": "https://example.com/api/social/twitch/login_redirect?projectId={projectId}&fields=email",
  "twitter": "https://example.com/api/social/twitter/login_redirect?projectId={projectId}&fields=email",
  "vimeo": "https://example.com/api/social/vimeo/login_redirect?projectId={projectId}&fields=email",
  "vk": "https://example.com/api/social/vk/login_redirect?projectId={projectId}&fields=email",
  "wechat": "https://example.com/api/social/wechat/login_redirect?projectId={projectId}&fields=email",
  "weibo": "https://example.com/api/social/weibo/login_redirect?projectId={projectId}&fields=email",
  "yahoo": "https://example.com/api/social/yahoo/login_redirect?projectId={projectId}&fields=email",
  "yandex": "https://example.com/api/social/yandex/login_redirect?projectId={projectId}&fields=email",
  "youtube": "https://example.com/api/social/youtube/login_redirect?projectId={projectId}&fields=email"
}
{
  "amazon": "https://example.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email",
  "baidu": "https://example.com/api/social/baidu/login_redirect?projectId={projectId}&fields=email",
  "battlenet": "https://example.com/api/social/battlenet/login_redirect?projectId={projectId}&fields=email",
  "china_telecom": "https://example.com/api/social/china_telecom/login_redirect?projectId={projectId}&fields=email",
  "discord": "https://example.com/api/social/discord/login_redirect?projectId={projectId}&fields=email",
  "facebook": "https://example.com/api/social/facebook/login_redirect?projectId={projectId}&fields=email",
  "github": "https://example.com/api/social/github/login_redirect?projectId={projectId}&fields=email",
  "google": "https://example.com/api/social/google/login_redirect?projectId={projectId}&fields=email",
  "google+": "https://example.com/api/social/google+/login_redirect?projectId={projectId}&fields=email",
  "instagram": "https://example.com/api/social/instagram/login_redirect?projectId={projectId}&fields=email",
  "kakao": "https://example.com/api/social/kakao/login_redirect?projectId={projectId}&fields=email",
  "linkedin": "https://example.com/api/social/linkedin/login_redirect?projectId={projectId}&fields=email",
  "mailru": "https://example.com/api/social/mailru/login_redirect?projectId={projectId}&fields=email",
  "microsoft": "https://example.com/api/social/microsoft/login_redirect?projectId={projectId}&fields=email",
  "msn": "https://example.com/api/social/msn/login_redirect?projectId={projectId}&fields=email",
  "naver": "https://example.com/api/social/naver/login_redirect?projectId={projectId}&fields=email",
  "ok": "https://example.com/api/social/ok/login_redirect?projectId={projectId}&fields=email",
  "paypal": "https://example.com/api/social/paypal/login_redirect?projectId={projectId}&fields=email",
  "pinterest": "https://example.com/api/social/pinterest/login_redirect?projectId={projectId}&fields=email",
  "qq": "https://example.com/api/social/qq/login_redirect?projectId={projectId}&fields=email",
  "reddit": "https://example.com/api/social/reddit/login_redirect?projectId={projectId}&fields=email",
  "steam": "https://example.com/api/social/steam/login_redirect?projectId={projectId}&fields=email",
  "twitch": "https://example.com/api/social/twitch/login_redirect?projectId={projectId}&fields=email",
  "twitter": "https://example.com/api/social/twitter/login_redirect?projectId={projectId}&fields=email",
  "vimeo": "https://example.com/api/social/vimeo/login_redirect?projectId={projectId}&fields=email",
  "vk": "https://example.com/api/social/vk/login_redirect?projectId={projectId}&fields=email",
  "wechat": "https://example.com/api/social/wechat/login_redirect?projectId={projectId}&fields=email",
  "weibo": "https://example.com/api/social/weibo/login_redirect?projectId={projectId}&fields=email",
  "yahoo": "https://example.com/api/social/yahoo/login_redirect?projectId={projectId}&fields=email",
  "yandex": "https://example.com/api/social/yandex/login_redirect?projectId={projectId}&fields=email",
  "youtube": "https://example.com/api/social/youtube/login_redirect?projectId={projectId}&fields=email"
}
{
  "amazon": "https://example.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email",
  "baidu": "https://example.com/api/social/baidu/login_redirect?projectId={projectId}&fields=email",
  "battlenet": "https://example.com/api/social/battlenet/login_redirect?projectId={projectId}&fields=email",
  "china_telecom": "https://example.com/api/social/china_telecom/login_redirect?projectId={projectId}&fields=email",
  "discord": "https://example.com/api/social/discord/login_redirect?projectId={projectId}&fields=email",
  "facebook": "https://example.com/api/social/facebook/login_redirect?projectId={projectId}&fields=email",
  "github": "https://example.com/api/social/github/login_redirect?projectId={projectId}&fields=email",
  "google": "https://example.com/api/social/google/login_redirect?projectId={projectId}&fields=email",
  "google+": "https://example.com/api/social/google+/login_redirect?projectId={projectId}&fields=email",
  "instagram": "https://example.com/api/social/instagram/login_redirect?projectId={projectId}&fields=email",
  "kakao": "https://example.com/api/social/kakao/login_redirect?projectId={projectId}&fields=email",
  "linkedin": "https://example.com/api/social/linkedin/login_redirect?projectId={projectId}&fields=email",
  "mailru": "https://example.com/api/social/mailru/login_redirect?projectId={projectId}&fields=email",
  "microsoft": "https://example.com/api/social/microsoft/login_redirect?projectId={projectId}&fields=email",
  "msn": "https://example.com/api/social/msn/login_redirect?projectId={projectId}&fields=email",
  "naver": "https://example.com/api/social/naver/login_redirect?projectId={projectId}&fields=email",
  "ok": "https://example.com/api/social/ok/login_redirect?projectId={projectId}&fields=email",
  "paypal": "https://example.com/api/social/paypal/login_redirect?projectId={projectId}&fields=email",
  "pinterest": "https://example.com/api/social/pinterest/login_redirect?projectId={projectId}&fields=email",
  "qq": "https://example.com/api/social/qq/login_redirect?projectId={projectId}&fields=email",
  "reddit": "https://example.com/api/social/reddit/login_redirect?projectId={projectId}&fields=email",
  "steam": "https://example.com/api/social/steam/login_redirect?projectId={projectId}&fields=email",
  "twitch": "https://example.com/api/social/twitch/login_redirect?projectId={projectId}&fields=email",
  "twitter": "https://example.com/api/social/twitter/login_redirect?projectId={projectId}&fields=email",
  "vimeo": "https://example.com/api/social/vimeo/login_redirect?projectId={projectId}&fields=email",
  "vk": "https://example.com/api/social/vk/login_redirect?projectId={projectId}&fields=email",
  "wechat": "https://example.com/api/social/wechat/login_redirect?projectId={projectId}&fields=email",
  "weibo": "https://example.com/api/social/weibo/login_redirect?projectId={projectId}&fields=email",
  "yahoo": "https://example.com/api/social/yahoo/login_redirect?projectId={projectId}&fields=email",
  "yandex": "https://example.com/api/social/yandex/login_redirect?projectId={projectId}&fields=email",
  "youtube": "https://example.com/api/social/youtube/login_redirect?projectId={projectId}&fields=email"
}
{
  "amazon": "https://example.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email",
  "baidu": "https://example.com/api/social/baidu/login_redirect?projectId={projectId}&fields=email",
  "battlenet": "https://example.com/api/social/battlenet/login_redirect?projectId={projectId}&fields=email",
  "china_telecom": "https://example.com/api/social/china_telecom/login_redirect?projectId={projectId}&fields=email",
  "discord": "https://example.com/api/social/discord/login_redirect?projectId={projectId}&fields=email",
  "facebook": "https://example.com/api/social/facebook/login_redirect?projectId={projectId}&fields=email",
  "github": "https://example.com/api/social/github/login_redirect?projectId={projectId}&fields=email",
  "google": "https://example.com/api/social/google/login_redirect?projectId={projectId}&fields=email",
  "google+": "https://example.com/api/social/google+/login_redirect?projectId={projectId}&fields=email",
  "instagram": "https://example.com/api/social/instagram/login_redirect?projectId={projectId}&fields=email",
  "kakao": "https://example.com/api/social/kakao/login_redirect?projectId={projectId}&fields=email",
  "linkedin": "https://example.com/api/social/linkedin/login_redirect?projectId={projectId}&fields=email",
  "mailru": "https://example.com/api/social/mailru/login_redirect?projectId={projectId}&fields=email",
  "microsoft": "https://example.com/api/social/microsoft/login_redirect?projectId={projectId}&fields=email",
  "msn": "https://example.com/api/social/msn/login_redirect?projectId={projectId}&fields=email",
  "naver": "https://example.com/api/social/naver/login_redirect?projectId={projectId}&fields=email",
  "ok": "https://example.com/api/social/ok/login_redirect?projectId={projectId}&fields=email",
  "paypal": "https://example.com/api/social/paypal/login_redirect?projectId={projectId}&fields=email",
  "pinterest": "https://example.com/api/social/pinterest/login_redirect?projectId={projectId}&fields=email",
  "qq": "https://example.com/api/social/qq/login_redirect?projectId={projectId}&fields=email",
  "reddit": "https://example.com/api/social/reddit/login_redirect?projectId={projectId}&fields=email",
  "steam": "https://example.com/api/social/steam/login_redirect?projectId={projectId}&fields=email",
  "twitch": "https://example.com/api/social/twitch/login_redirect?projectId={projectId}&fields=email",
  "twitter": "https://example.com/api/social/twitter/login_redirect?projectId={projectId}&fields=email",
  "vimeo": "https://example.com/api/social/vimeo/login_redirect?projectId={projectId}&fields=email",
  "vk": "https://example.com/api/social/vk/login_redirect?projectId={projectId}&fields=email",
  "wechat": "https://example.com/api/social/wechat/login_redirect?projectId={projectId}&fields=email",
  "weibo": "https://example.com/api/social/weibo/login_redirect?projectId={projectId}&fields=email",
  "yahoo": "https://example.com/api/social/yahoo/login_redirect?projectId={projectId}&fields=email",
  "yandex": "https://example.com/api/social/yandex/login_redirect?projectId={projectId}&fields=email",
  "youtube": "https://example.com/api/social/youtube/login_redirect?projectId={projectId}&fields=email"
}
{
  "amazon": "https://example.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email",
  "baidu": "https://example.com/api/social/baidu/login_redirect?projectId={projectId}&fields=email",
  "battlenet": "https://example.com/api/social/battlenet/login_redirect?projectId={projectId}&fields=email",
  "china_telecom": "https://example.com/api/social/china_telecom/login_redirect?projectId={projectId}&fields=email",
  "discord": "https://example.com/api/social/discord/login_redirect?projectId={projectId}&fields=email",
  "facebook": "https://example.com/api/social/facebook/login_redirect?projectId={projectId}&fields=email",
  "github": "https://example.com/api/social/github/login_redirect?projectId={projectId}&fields=email",
  "google": "https://example.com/api/social/google/login_redirect?projectId={projectId}&fields=email",
  "google+": "https://example.com/api/social/google+/login_redirect?projectId={projectId}&fields=email",
  "instagram": "https://example.com/api/social/instagram/login_redirect?projectId={projectId}&fields=email",
  "kakao": "https://example.com/api/social/kakao/login_redirect?projectId={projectId}&fields=email",
  "linkedin": "https://example.com/api/social/linkedin/login_redirect?projectId={projectId}&fields=email",
  "mailru": "https://example.com/api/social/mailru/login_redirect?projectId={projectId}&fields=email",
  "microsoft": "https://example.com/api/social/microsoft/login_redirect?projectId={projectId}&fields=email",
  "msn": "https://example.com/api/social/msn/login_redirect?projectId={projectId}&fields=email",
  "naver": "https://example.com/api/social/naver/login_redirect?projectId={projectId}&fields=email",
  "ok": "https://example.com/api/social/ok/login_redirect?projectId={projectId}&fields=email",
  "paypal": "https://example.com/api/social/paypal/login_redirect?projectId={projectId}&fields=email",
  "pinterest": "https://example.com/api/social/pinterest/login_redirect?projectId={projectId}&fields=email",
  "qq": "https://example.com/api/social/qq/login_redirect?projectId={projectId}&fields=email",
  "reddit": "https://example.com/api/social/reddit/login_redirect?projectId={projectId}&fields=email",
  "steam": "https://example.com/api/social/steam/login_redirect?projectId={projectId}&fields=email",
  "twitch": "https://example.com/api/social/twitch/login_redirect?projectId={projectId}&fields=email",
  "twitter": "https://example.com/api/social/twitter/login_redirect?projectId={projectId}&fields=email",
  "vimeo": "https://example.com/api/social/vimeo/login_redirect?projectId={projectId}&fields=email",
  "vk": "https://example.com/api/social/vk/login_redirect?projectId={projectId}&fields=email",
  "wechat": "https://example.com/api/social/wechat/login_redirect?projectId={projectId}&fields=email",
  "weibo": "https://example.com/api/social/weibo/login_redirect?projectId={projectId}&fields=email",
  "yahoo": "https://example.com/api/social/yahoo/login_redirect?projectId={projectId}&fields=email",
  "yandex": "https://example.com/api/social/yandex/login_redirect?projectId={projectId}&fields=email",
  "youtube": "https://example.com/api/social/youtube/login_redirect?projectId={projectId}&fields=email"
}
{
  "amazon": "https://example.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email",
  "baidu": "https://example.com/api/social/baidu/login_redirect?projectId={projectId}&fields=email",
  "battlenet": "https://example.com/api/social/battlenet/login_redirect?projectId={projectId}&fields=email",
  "china_telecom": "https://example.com/api/social/china_telecom/login_redirect?projectId={projectId}&fields=email",
  "discord": "https://example.com/api/social/discord/login_redirect?projectId={projectId}&fields=email",
  "facebook": "https://example.com/api/social/facebook/login_redirect?projectId={projectId}&fields=email",
  "github": "https://example.com/api/social/github/login_redirect?projectId={projectId}&fields=email",
  "google": "https://example.com/api/social/google/login_redirect?projectId={projectId}&fields=email",
  "google+": "https://example.com/api/social/google+/login_redirect?projectId={projectId}&fields=email",
  "instagram": "https://example.com/api/social/instagram/login_redirect?projectId={projectId}&fields=email",
  "kakao": "https://example.com/api/social/kakao/login_redirect?projectId={projectId}&fields=email",
  "linkedin": "https://example.com/api/social/linkedin/login_redirect?projectId={projectId}&fields=email",
  "mailru": "https://example.com/api/social/mailru/login_redirect?projectId={projectId}&fields=email",
  "microsoft": "https://example.com/api/social/microsoft/login_redirect?projectId={projectId}&fields=email",
  "msn": "https://example.com/api/social/msn/login_redirect?projectId={projectId}&fields=email",
  "naver": "https://example.com/api/social/naver/login_redirect?projectId={projectId}&fields=email",
  "ok": "https://example.com/api/social/ok/login_redirect?projectId={projectId}&fields=email",
  "paypal": "https://example.com/api/social/paypal/login_redirect?projectId={projectId}&fields=email",
  "pinterest": "https://example.com/api/social/pinterest/login_redirect?projectId={projectId}&fields=email",
  "qq": "https://example.com/api/social/qq/login_redirect?projectId={projectId}&fields=email",
  "reddit": "https://example.com/api/social/reddit/login_redirect?projectId={projectId}&fields=email",
  "steam": "https://example.com/api/social/steam/login_redirect?projectId={projectId}&fields=email",
  "twitch": "https://example.com/api/social/twitch/login_redirect?projectId={projectId}&fields=email",
  "twitter": "https://example.com/api/social/twitter/login_redirect?projectId={projectId}&fields=email",
  "vimeo": "https://example.com/api/social/vimeo/login_redirect?projectId={projectId}&fields=email",
  "vk": "https://example.com/api/social/vk/login_redirect?projectId={projectId}&fields=email",
  "wechat": "https://example.com/api/social/wechat/login_redirect?projectId={projectId}&fields=email",
  "weibo": "https://example.com/api/social/weibo/login_redirect?projectId={projectId}&fields=email",
  "yahoo": "https://example.com/api/social/yahoo/login_redirect?projectId={projectId}&fields=email",
  "yandex": "https://example.com/api/social/yandex/login_redirect?projectId={projectId}&fields=email",
  "youtube": "https://example.com/api/social/youtube/login_redirect?projectId={projectId}&fields=email"
}
{
  "amazon": "https://example.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email",
  "baidu": "https://example.com/api/social/baidu/login_redirect?projectId={projectId}&fields=email",
  "battlenet": "https://example.com/api/social/battlenet/login_redirect?projectId={projectId}&fields=email",
  "china_telecom": "https://example.com/api/social/china_telecom/login_redirect?projectId={projectId}&fields=email",
  "discord": "https://example.com/api/social/discord/login_redirect?projectId={projectId}&fields=email",
  "facebook": "https://example.com/api/social/facebook/login_redirect?projectId={projectId}&fields=email",
  "github": "https://example.com/api/social/github/login_redirect?projectId={projectId}&fields=email",
  "google": "https://example.com/api/social/google/login_redirect?projectId={projectId}&fields=email",
  "google+": "https://example.com/api/social/google+/login_redirect?projectId={projectId}&fields=email",
  "instagram": "https://example.com/api/social/instagram/login_redirect?projectId={projectId}&fields=email",
  "kakao": "https://example.com/api/social/kakao/login_redirect?projectId={projectId}&fields=email",
  "linkedin": "https://example.com/api/social/linkedin/login_redirect?projectId={projectId}&fields=email",
  "mailru": "https://example.com/api/social/mailru/login_redirect?projectId={projectId}&fields=email",
  "microsoft": "https://example.com/api/social/microsoft/login_redirect?projectId={projectId}&fields=email",
  "msn": "https://example.com/api/social/msn/login_redirect?projectId={projectId}&fields=email",
  "naver": "https://example.com/api/social/naver/login_redirect?projectId={projectId}&fields=email",
  "ok": "https://example.com/api/social/ok/login_redirect?projectId={projectId}&fields=email",
  "paypal": "https://example.com/api/social/paypal/login_redirect?projectId={projectId}&fields=email",
  "pinterest": "https://example.com/api/social/pinterest/login_redirect?projectId={projectId}&fields=email",
  "qq": "https://example.com/api/social/qq/login_redirect?projectId={projectId}&fields=email",
  "reddit": "https://example.com/api/social/reddit/login_redirect?projectId={projectId}&fields=email",
  "steam": "https://example.com/api/social/steam/login_redirect?projectId={projectId}&fields=email",
  "twitch": "https://example.com/api/social/twitch/login_redirect?projectId={projectId}&fields=email",
  "twitter": "https://example.com/api/social/twitter/login_redirect?projectId={projectId}&fields=email",
  "vimeo": "https://example.com/api/social/vimeo/login_redirect?projectId={projectId}&fields=email",
  "vk": "https://example.com/api/social/vk/login_redirect?projectId={projectId}&fields=email",
  "wechat": "https://example.com/api/social/wechat/login_redirect?projectId={projectId}&fields=email",
  "weibo": "https://example.com/api/social/weibo/login_redirect?projectId={projectId}&fields=email",
  "yahoo": "https://example.com/api/social/yahoo/login_redirect?projectId={projectId}&fields=email",
  "yandex": "https://example.com/api/social/yandex/login_redirect?projectId={projectId}&fields=email",
  "youtube": "https://example.com/api/social/youtube/login_redirect?projectId={projectId}&fields=email"
}

Authentication via a Social Network

Authenticates the user via the social network connected to Login in Publisher Account.

HTTP REQUEST

GET https://login.xsolla.com/api/social/{providerName}/login_redirect?projectId={projectId}&fields={fields}&login_url={login_url}

Parameter Type Description
providerName
string The name of the social network connected to Login in Publisher Account. Can be: 'amazon', 'baidu', 'battlenet', 'china_telecom', 'discord', 'facebook', 'github', 'google', 'google+', 'instagram', 'kakao', 'linkedin', 'mailru.oauth', 'microsoft', 'msn', 'naver', 'ok', 'paradox', 'paypal', 'pinterest', 'qq', 'reddit', 'steam', 'twitch', 'twitter', 'vimeo', 'vk', 'wechat', 'weibo', 'yahoo', 'yandex', 'youtube'. Required.
projectId
string Login ID from Publisher Account. Required.
fields
array of strings List of parameters required for successful user registration/authentication. Example: 'email, promo_email_agreement'. The user will be asked to specify these parameters in the corresponding form.
login_url
string URL to generate the link for social network authentication. Must be identical to the Callback URL specified in Publisher Account in Login settings. Required if there are several Callback URLs.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
Request
GET https://login.xsolla.com/api/social/amazon/login_redirect?fields=email&login_url=https://example.com&projectId={projectId}
curl --request GET \
  --url 'https://login.xsolla.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://login.xsolla.com/api/social/amazon/login_redirect');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString(array(
  'projectId' => '{projectId}',
  'fields' => 'email',
  'login_url' => 'https://example.com'
)));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://login.xsolla.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("login.xsolla.com")

conn.request("GET", "/api/social/amazon/login_redirect?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://login.xsolla.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://login.xsolla.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com")
  .get()
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://login.xsolla.com/api/social/amazon/login_redirect?projectId={projectId}&fields=email&login_url=https%3A%2F%2Fexample.com");

xhr.send(data);
Response