Documentation

LoginWithServerCustomId

Securely login a game client from an external server backend using a custom identifier for that player. Server Custom ID and Client Custom ID are mutually exclusive and cannot be used to retrieve the same player account.

Request Details

LoginWithServerCustomIdRequest
Request Properties
CreateAccount Boolean

Automatically create a PlayFab account if one is not currently linked to this ID.

InfoRequestParameters GetPlayerCombinedInfoRequestParams

Flags for which pieces of info to return for the user.

PlayerSecret String

Player secret that is used to verify API request signatures (Enterprise Only).

ServerCustomId String

The backend server identifier for this player.

POST https://{{TitleID}}.playfabapi.com/Server/LoginWithServerCustomId
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "ServerCustomId": "asdalsdkjar09u23ijf",
  "CreateAccount": true
}
        

Response Details

ServerLoginResult
Result Properties
EntityToken EntityTokenResponse

If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and returned.

InfoResultPayload GetPlayerCombinedInfoResultPayload

Results for requested info.

LastLoginTime DateTime

The time of this user's previous login. If there was no previous login, then it's DateTime.MinValue

NewlyCreated (required) Boolean

True if the account was newly created on this login.

PlayFabId String

Player's unique PlayFabId.

SessionTicket String

Unique token authorizing the user and game at the server level, for the current session.

SettingsForUser UserSettings

Settings specific to this user.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8


Authentication

SecretKey

Possible Error Codes

Name Code
AccountBanned 1002
AccountNotFound 1001