https://login.xsolla.com/api
Dieser Abschnitt beschreibt API-Aufrufe für die Arbeit mit Login. Konfigurieren Sie Ihr Login-Projekt im Kundenportal, bevor Sie Anfragen senden.
The full list of IP addresses that login.xsolla.com may use:
Im Kundenportal haben Sie Zugriff auf die folgenden Login-Projekttypen:
Weitere Informationen dazu finden Sie unter Plattformübergreifendes Konto.
Are the restrictions applied by Xsolla API on the frequency of access by a user within a defined timeframe.
Ist ein in einem Standard-Login-Projekt erstellter Kontotyp und wird mit Plattformkonten verknüpft. Das Hauptkonto dient dazu, Spieler auf verschiedenen Plattformen zu identifizieren.
Ist ein in einem Schatten-Login-Projekt erstellter Kontotyp und wird mit einer bestimmten Publishing-Plattform verknüpft. Das Plattformkonto lässt sich mit keinem weiteren Plattformkonto verknüpfen. Zudem können Sie die Verknüpfung zwischen einem solchen Konto und einem Hauptkonto nicht aufheben.
Ist eine Plattform zur Distribution von Spielen (z. B. Steam, PlayStation, Xbox usw.).
Die Login API unterstützt die folgenden Tokentypen:
Ob ein API-Aufruf client- oder serverseitig erfolgt, können Sie anhand des Authentifizierungsschemas feststellen:
Authorization
header: Bearer <user_JWT>
header,
where <user_JWT>
— is the user token.X-SERVER-AUTHORIZATION: <server_JWT>
, where
<server_JWT>
— is the server token.Senden Sie eine der folgenden Anfragen, um den Token abzurufen:
Nach der JWT-Authentifizierung wird der Benutzer mithilfe eines Tokens in einem
Abfrageparameter zur Rückruf-URL weitergeleitet: <Callback URL>?token=<User token (JWT)>
.
Senden Sie nach der auf dem OAuth 2.0-Protokoll basierenden Authentifizierung
die Anfrage JWT generieren an den Xsolla-Login-Server, um den empfangenen code
-Parameter
gegen einen Benutzertoken (access_token
) zu tauschen.
So rufen Sie ein Servertoken ab:
Implementieren Sie im Backend Ihrer Anwendung eine Methode, um den Server-JWT mithilfe des API-Aufrufs JWT generieren abzurufen. Die Anfrage muss folgende Parameter enthalten:
grant_type
is the type of getting JWT, pass the client_credentials
value.client_secret
is the secret key that is received when you set up the server
OAuth 2.0 client.client_id
is the client ID received when you set up the server OAuth 2.0
client.To prevent Xsolla system overloads and protect against sudden spikes in
incoming traffic, Xsolla limits the number of requests received by the Xsolla
API within a specified period of time. If the limit is exceeded, the Xsolla API
returns an HTTP response with the 429
status code.
Rate limits vary by method, IP-address, authentication scheme, and other factors.
Rate limits for server-side methods are applied to methods with server-side
authentication — methods that are called with the X-SERVER-AUTHORIZATION:
<server_JWT>
header, where <server_JWT>
is the server
token.
Rate limits for client-side methods are applied to methods without
authentication or with client-side authentication — methods that are called
with the Authorization: Bearer <user_JWT>
header, where
<user_JWT>
is the user token.
Example of a method with server-side authentication: Example of a method with client-side authentication:
Rate limits for client-side methods do not change and are necessary to prevent brute-force attacks. The maximum request rate for server-side methods is higher than for client-side methods. You can refer to the recommendations on how to manage rate limits in the documentation.
Jeder Token hat ein JWT-Format und enthält eine bestimmte Information in einer Payload.
Ein Benutzer-JWT ist ein Token, der infolge einer Authentifizierung oder Registrierung empfangen wird. Eine Token-Payload enthält Informationen über den Benutzer und den Authentifizierungsaufruf.
Um einen Benutzertoken über das OAuth 2.0-Protokoll abzurufen, ist ein OAuth
2.0-Client erforderlich. Der Benutzertoken wird im Header Authorization: Bearer <JWT>
übermittelt.
Nach der Authentifizierung oder Bestätigung der E-Mail-Adresse enthält ein Token die wichtigsten Claims. Ob diese Claims vorhanden sind, hängt nicht von der Nutzerdatenbank und dem Authentifizierungsaufruf ab.
Claim | Typ | Erforderlich | Beschreibung |
exp |
Unix-Zeitstempel | Ja | Datum und Uhrzeit des Tokenverfalls. Die Standardverfallszeit beträgt 24 Stunden. Sie können die Verfallszeit für jedes Login-Projekt individuell festlegen. |
iss |
String | Ja | Dienst, der den Token signiert hat: https://login.xsolla.com . |
iat |
Unix-Zeitstempel | Ja | Datum und Uhrzeit der Tokenübermittlung. |
sub |
String (UUID) | Ja | Aufseiten des Xsolla-Login-Servers geschriebene Benutzer-ID. |
groups |
Array | Ja |
Liste der Gruppen, denen der Benutzer zugeordnet ist. Jede Gruppe wird in dem folgendem Format geschrieben:
Es kann nur eine Standardgruppe geben. Diese Gruppe umfasst zunächst alle Benutzer, bevor diese verschiedenen Gruppen zugeordnet werden. |
xsolla_login_project_id |
String (UUID) | Ja | Login-Projekt-ID. |
type |
String |
Authentifizierungsoption:
Es kann nur eine Standardgruppe geben. Diese Gruppe umfasst zunächst alle Benutzer, bevor diese verschiedenen Gruppen zugeordnet werden. |
|
avatar |
String | Benutzer-Avatar-URL. | |
username |
String | Benutzername. | |
publisher_id |
Integer | ID eines Händlers, dem ein Login-Projekt gehört. | |
email |
String | E-Mail-Adresse des Benutzers. | |
payload |
String | Zusätzliche Informationen, die während der Authentifizierung im Payload-Parameter übermittelt werden. | |
promo_email_agreement |
boolesch |
Folgende Werte sind möglich:
true ist standardmäßig eingestellt.
So fügen Sie die Funktion der Registrierungsmaske des Login-Widgets hinzu:
|
|
connection_information |
String | Zeigt an, ob der Benutzer sein Geburtsdatum bestätigt hat oder nicht. Die Bestätigung erfolgt über den Dienst okname. |
Claims, die nach der Authentifizierung im Token enthalten sind, sofern Sie den PlayFab-Speicher verwenden.
Claim | Typ | Erforderlich | Beschreibung |
external_account_id |
String | Ja | PlayFab-ID des Benutzers. |
session_ticket |
String | Ja |
Ein während einer Authentifizierungsanfrage oder während Anfragen an die PlayFab API empfangener SessionTicket-Parameter. Ein Token enthält diesen Claim, wenn Sie Benutzer über das OAuth 2.0-Protokoll authentifizieren und dabei den Wert |
entity_token |
String | Ja | Ein EntityToken.EntityToken-Parameter. |
entity_type |
String | Ja | Ein EntityToken.Entity.Type-Parameter. Einzig möglicher Wert:title_player_account . |
entity_id |
String | Ja | Ein EntityToken.Entity.Id-Parameter. |
Claims, die nach der Authentifizierung im Token enthalten sind, sofern Sie einen eigenen Speicher verwenden.
Claim | Typ | Erforderlich | Beschreibung |
provider |
String | Ja | Name des sozialen Netzwerks, das zur Authentifizierung verwendet wird. Wenn sich der Benutzer über einen Benutzernamen und ein Passwort authentifiziert, hat der Claim den Wert xsolla . |
external_account_id |
String | Benutzer-ID aufseiten Ihres Servers. | |
partner_data |
Data of any type returned by your server in the response body during authentication. To enable the transmission of this claim, contact your Customer Success Manager or email to csm@xsolla.com | ||
social_access_token |
Access token of the social network through which the user was authenticated. To enable the transmission of this claim, contact your Customer Success Manager or email to csm@xsolla.com. |
Claims, die nach der Authentifizierung über ein soziales Netzwerk im Token enthalten sind. Ob diese Claims vorhanden sind, hängt nicht von der Nutzerdatenbank ab.
Claim | Typ | Erforderlich | Beschreibung |
provider |
String | Ja | Name des zur Authentifizierung verwendeten sozialen Netzwerks. |
id |
String | Ja | Benutzer-ID im sozialen Netzwerk. |
is_cross_auth |
boolesch | Zeigt an, dass die Stille-Authentifizierung-Anfrage läuft. | |
social_access_token |
String | Der zur Authentifizierung genutzte access_token -Parameter des Social-Media-Kontos. Wenden Sie sich an Ihren Account Manager, um die Funktion einzurichten. |
|
picture |
String (URL) | Link zum Profilbild des Benutzers in einem sozialen Netzwerk. | |
birthday |
Datum (RFC3339) | Geburtsdatum des Benutzers in einem sozialen Netzwerk. | |
gender |
String | Geschlecht des Benutzers in einem sozialen Netzwerk. | |
name |
String | Nickname des Benutzers in einem sozialen Netzwerk. |
Claims, die nach der OAuth 2.0-Authentifizierung im Token enthalten sind.
Claim | Typ | Erforderlich | Beschreibung |
jti |
String | Ja | Eindeutige Token-ID. |
Claim, der nach der Authentifizierung über eine Telefonnummer im Token enthalten ist.
Claim | Typ | Erforderlich | Beschreibung |
phone_number |
String | Ja | Die zur Authentifizierung verwendete Telefonnummer des Benutzers. Das Telefonnummernformat setzt sich zusammen aus Landesvorwahl, nationaler Vorwahl und Anschlusskennung ohne Trennzeichen. |
Der Servertoken wird im X-SERVER-AUTHORIZATION
-Header übermittelt.
Die Token-Payload enthält Informationen über Ressourcen, die dem OAuth 2.0-Client gehören. Der Token kann auf diese Ressourcen durch Aufrufe mit serverbasierter Authentifizierung zugreifen.
Claim | Typ | Erforderlich | Beschreibung |
xsolla_login_project_id |
String (UUID) | Ja | ID eines Login-Projekts, das dem OAuth 2.0-Client gehört. |
resources |
Array | Ja |
Liste der Ressourcen, die einem OAuth 2.0-Client gehören. Mögliche Ressourcentypen:
Jede Gruppe wird im folgenden Format geschrieben:
|
jti |
String | Ja | Eindeutige Token-ID. |
To validate the JWT, use the following Login API calls:
Hinweis
Geben Sie Ihren geheimen Schlüssel niemals weiter. Falls er kompromittiert wurde, aktualisieren Sie ihn bitte.
Bei Fehlermeldungen gibt der Xsolla-Login-Server ein JSON-Objekt mit den folgenden Feldern zurück:
Feld | Typ | Beschreibung |
code | String | Fehlercode des Xsolla-Login-Servers. |
Beschreibung | String | Fehlerbeschreibung. Der Text ist immer in Englisch. Verwenden Sie diesen Text nicht im Falle eines Fehlers, da sich der Wert in Zukunft ändern kann. |
{
"error": {
"code": "000-000",
"description": "description"
}
}
Error Code | Beschreibung | Recommendation |
---|---|---|
002–016 | The user should try to log in again. | |
002-027 | Make sure all request parameters are correct. | |
002-028 | Make sure all required parameters are provided. | |
002–040 | The user should contact the game support team. | |
002-043 | The user should try another phone number that can receive SMS. | |
002–050 | The error occurs when trying to enable two-factor authentication if it's already enabled, or disable it if it's already disabled. | |
002-056 | The user should verify the phone number or enter a different one. | |
002-057 | The user should try again later. If you believe this error should not occur, please contact the integrator team in any messenger. | |
002-058 | The user should use the link in the email to unblock their account or reset the password. | |
002-060 | Inform the user of the age restrictions. | |
003–001 | The user should verify the entered information and try again. | |
003–002 | The user should sign up in the game to continue. | |
003–003 | The user should try a different username. | |
003-004 | The user should use a different email address. | |
003-005 | The user should try a different email address. | |
003–007 | The user should confirm their email address to activate the account. If they haven't received a confirmation email, they should check the spam folder. | |
003-008 | Changing the email address is not allowed. | |
003-009 | The search failed for technical reasons, please try again later. | |
003-010 | Changing the birth date is not allowed. | |
003-011 | The user should confirm the email address or use another one that has not been previously used during registration. | |
003-012 | The user should confirm the phone number or use another one that has not been previously used during registration. | |
003–019 | Check the existence of the authentication variant with the passed ID. | |
003–020 | Check the authorization option settings in your Publisher Account. | |
003-021 | The user should contact game support. | |
003–022 | Verify the authorization option settings in your Publisher Account. | |
003-023 | Registration is not allowed for this authorization option. The user should contact game support. | |
003-030 | The password reset link has expired or is incorrect. The user should attempt to reset the password again. | |
003-049 | The user should try again later. | |
007-001 | The user should use an alternative login method. | |
008-001 | Add the correct login URL in the authorization option settings in your Publisher Account (section User database > Storage > Custom storage). | |
008-002 | Add the correct user verification URL in the authorization option settings in your Publisher Account (section User database > Storage > Custom storage). | |
008-003 | Add the correct URL in the authorization option settings in your Publisher Account (section User database > Storage > Custom storage). | |
008-004 | Add the correct password reset URL in the authorization option settings in your Publisher Account (section User database > Storage > Custom storage). | |
008-005 | Ensure the correct Title ID is specified in the authorization option settings in your Publisher Account (section User database > Storage). | |
008-006 | Ensure the PlayFab API key is valid. | |
008-008 | Ensure the server returns the accountID parameter in the response body. |
|
008-009 | Verify the URLs specified in the Custom storage settings in the authorization option in your Publisher Account (section User database > Storage > Custom storage). | |
008-011 | Ensure that the callback URL for password reset is specified in the authorization option settings in your Publisher Account (section Password settings). | |
008-013 | Ensure that a link to the user agreement is specified in the authorization option settings in your Publisher Account (section Legal Terms > Policies and Agreements). | |
008-014 | Contact the integration team through any messenger. | |
008-015 | Contact the integration team through any messenger. | |
008-016 | Add the API key to the settings in your Publisher Account (section Legal Terms > Policies and Agreements). | |
010-004 | The user should try again later. | |
010–005 | The user should try again later. | |
010-006 | The user should add another authentication method before unlinking the social network. | |
010-007 | The user should complete the CAPTCHA again. | |
010-010 | The user should verify the code and try again. | |
010-014 | The user should log in again from the login page. | |
010–015 | The user should try again later. | |
010–016 | The user should use a different social account. If they believe this is an error, they should contact the integration team through any messenger. | |
010-017 | Verify the correctness of the request parameters being sent. | |
010–019 | Ensure that a client with the provided client_id exists. |
|
010-020 | Ensure that the provided scope parameter is correct. Refer to the instructions for detailed setup information. |
|
010-021 | Ensure that the value of the response_type parameter is set to "code" . |
|
010–022 | Ensure that the state parameter is present and consists of at least 8 characters. | |
010–023 | Ensure that the authorization code is valid and not expired, and that the redirect_uri parameter contains an authorized URL. Refer to the instructions for detailed setup information. |
|
010–026 | Ensure that you have sufficient permissions to access the resource. | |
010-030 | Ensure that cross-authentication is enabled for the authorization option. Refer to the instructions for detailed setup information. | |
010-031 | The error occurs when attempting to connect a social network that is already enabled. | |
010–032 | Ensure that the social network is enabled and configured in the authorization option settings in your Publisher Account (section Authorization via Social Networks). | |
010-033 | The user should try again later. | |
010-035 | The user should try again later. | |
010-045 | The user should use a different social account for registration. | |
030–024 | The user should contact the game support team. | |
040-001 | The user should enter an email address containing no more than 254 characters. | |
040-002 | The user should enter a valid email address. | |
040-003 | The user should enter a different email address. | |
040-004 | The user should contact Xsolla support. | |
040-005 | The user should enter an email with only one @ character. |
|
040-006, 040-007, 040-008 | The user should contact Xsolla support. | |
040-009 | The user should enter an email with an existing domain. | |
040-010 | The user should contact Xsolla support. | |
010-018 | The user should enter a different email address. | |
300-003 | The user should try again later. | |
300-005 | The user should try again later. | |
300-006 | The user should verify and re-enter the confirmation code. | |
300-008 | The user should use the new code sent to their email or phone. | |
003–007 | The user should confirm their email address to activate the account. If they haven't received a confirmation email, they should check the spam folder. | |
003–025 | The user should try a different authentication method. | |
003–040 | The user should log in again. | |
003–033 | Ensure that shadow authentication is used for the authorization option. | |
2002–0001 | Make sure that the attribute being created has not been previously added to the user. |