Authentication - Set Player Secret

Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's secret use the Admin or Server API method SetPlayerSecret.

POST https://titleId.playfabapi.com/Client/SetPlayerSecret

Request Header

Name Required Type Description
X-Authorization True

string

This API requires a client session ticket, available from any Client Login function.

Request Body

Name Type Description
EncryptedRequest

string

Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only).

PlayerSecret

string

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

Responses

Name Type Description
200 OK

SetPlayerSecretResult

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-Authorization

This API requires a client session ticket, available from any Client Login function.

Type: apiKey
In: header

Definitions

Name Description
ApiErrorWrapper

The basic wrapper around every failed API response

SetPlayerSecretRequest

APIs that require signatures require that the player have a configured Player Secret Key that is used to sign all requests. Players that don't have a secret will be blocked from making API calls until it is configured. To create a signature header add a SHA256 hashed string containing UTF8 encoded JSON body as it will be sent to the server, the current time in UTC formatted to ISO 8601, and the players secret formatted as 'body.date.secret'. Place the resulting hash into the header X-PlayFab-Signature, along with a header X-PlayFab-Timestamp of the same UTC timestamp used in the signature.

SetPlayerSecretResult

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code

integer

Numerical HTTP code

error

string

Playfab error code

errorCode

integer

Numerical PlayFab error code

errorDetails

object

Detailed description of individual issues with the request object

errorMessage

string

Description for the PlayFab errorCode

status

string

String HTTP code

SetPlayerSecretRequest

APIs that require signatures require that the player have a configured Player Secret Key that is used to sign all requests. Players that don't have a secret will be blocked from making API calls until it is configured. To create a signature header add a SHA256 hashed string containing UTF8 encoded JSON body as it will be sent to the server, the current time in UTC formatted to ISO 8601, and the players secret formatted as 'body.date.secret'. Place the resulting hash into the header X-PlayFab-Signature, along with a header X-PlayFab-Timestamp of the same UTC timestamp used in the signature.

Name Type Description
EncryptedRequest

string

Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only).

PlayerSecret

string

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

SetPlayerSecretResult

Error Codes

Name Code
EncryptionKeyMissing 1290
PlayerSecretAlreadyConfigured 1294
PlayerSecretNotConfigured 1323