次の方法で共有


Authentication - Get Title Public Key

Returns the title's base 64 encoded RSA CSP blob.

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

Request Header

Name Required Type Description
None True

string

This API requires no authentication headers (usually provides one to other calls).

Request Body

Name Required Type Description
TitleId True

string

Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected.

TitleSharedSecret True

string

The shared secret key for this title

Responses

Name Type Description
200 OK

GetTitlePublicKeyResult

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

None

This API requires no authentication headers (usually provides one to other calls).

Type: apiKey
In: header

Definitions

Name Description
ApiErrorWrapper

The basic wrapper around every failed API response

GetTitlePublicKeyRequest

An RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. For example if Client/LoginWithCustomId requires signature headers but the player does not have an account yet follow these steps: 1) Call Client/GetTitlePublicKey with one of the title's shared secrets. 2) Convert the Base64 encoded CSP blob to a byte array and create an RSA signing object. 3) Encrypt the UTF8 encoded JSON body of the registration request and place the Base64 encoded result into the EncryptedRequest and with the TitleId field, all other fields can be left empty when performing the API request. 4) Client receives authentication token as normal. Future requests to LoginWithCustomId will require the X-PlayFab-Signature header.

GetTitlePublicKeyResult

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

GetTitlePublicKeyRequest

An RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. For example if Client/LoginWithCustomId requires signature headers but the player does not have an account yet follow these steps: 1) Call Client/GetTitlePublicKey with one of the title's shared secrets. 2) Convert the Base64 encoded CSP blob to a byte array and create an RSA signing object. 3) Encrypt the UTF8 encoded JSON body of the registration request and place the Base64 encoded result into the EncryptedRequest and with the TitleId field, all other fields can be left empty when performing the API request. 4) Client receives authentication token as normal. Future requests to LoginWithCustomId will require the X-PlayFab-Signature header.

Name Type Description
TitleId

string

Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected.

TitleSharedSecret

string

The shared secret key for this title

GetTitlePublicKeyResult

Name Type Description
RSAPublicKey

string

Base64 encoded RSA CSP byte array blob containing the title's public RSA key

Error Codes

Name Code
EncryptionKeyBroken 1291
InvalidSharedSecretKey 1296
NoSharedSecretKeyConfigured 1292