Authentication - Get Entity Token
Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid Entity Token.
POST https://titleId.playfabapi.com/Authentication/GetEntityToken
Request Header
Name | Required | Type | Description |
---|---|---|---|
None | True |
|
This API requires no authentication headers (usually provides one to other calls). |
Request Body
Name | Type | Description |
---|---|---|
CustomTags |
|
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). |
Entity |
The optional entity to perform this action on. Defaults to the currently logged in entity. |
Responses
Name | Type | Description |
---|---|---|
200 OK | ||
400 Bad Request |
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
Api |
The basic wrapper around every failed API response |
Entity |
Combined entity type and ID structure which uniquely identifies a single entity. |
Get |
This API must be called with X-SecretKey, X-Authentication or X-EntityToken headers. An optional EntityKey may be included to attempt to set the resulting EntityToken to a specific entity, however the entity must be a relation of the caller, such as the master_player_account of a character. If sending X-EntityToken the account will be marked as freshly logged in and will issue a new token. If using X-Authentication or X-EntityToken the header must still be valid and cannot be expired or revoked. |
Get |
ApiErrorWrapper
The basic wrapper around every failed API response
Name | Type | Description |
---|---|---|
code |
|
Numerical HTTP code |
error |
|
Playfab error code |
errorCode |
|
Numerical PlayFab error code |
errorDetails |
|
Detailed description of individual issues with the request object |
errorMessage |
|
Description for the PlayFab errorCode |
status |
|
String HTTP code |
EntityKey
Combined entity type and ID structure which uniquely identifies a single entity.
Name | Type | Description |
---|---|---|
Id |
|
Unique ID of the entity. |
Type |
|
Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types |
GetEntityTokenRequest
This API must be called with X-SecretKey, X-Authentication or X-EntityToken headers. An optional EntityKey may be included to attempt to set the resulting EntityToken to a specific entity, however the entity must be a relation of the caller, such as the master_player_account of a character. If sending X-EntityToken the account will be marked as freshly logged in and will issue a new token. If using X-Authentication or X-EntityToken the header must still be valid and cannot be expired or revoked.
Name | Type | Description |
---|---|---|
CustomTags |
|
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). |
Entity |
The optional entity to perform this action on. Defaults to the currently logged in entity. |
GetEntityTokenResponse
Name | Type | Description |
---|---|---|
Entity |
The entity id and type. |
|
EntityToken |
|
The token used to set X-EntityToken for all entity based API calls. |
TokenExpiration |
|
The time the token will expire, if it is an expiring token, in UTC. |
Error Codes
Name | Code |
---|---|
EncryptionKeyBroken | 1291 |
NoValidCertificateForAad | 1376 |