question

Alexander Klingel avatar image
Alexander Klingel asked

Create Server Backfill Ticket from Client/Authenticate as Title

We are using an external server provider (Photon) and I am trying to create server backfill tickets from a client. I know you probably shouldn't create the ticket from a client, but it's an API so I don't see why we can't. It appears that you can only create a server backfill ticket when the entity type in the authentication context is "title". Right now I'm using the player's authentication context, which is of type "title_player_account". Clearly this needs to be authentication context for the title/server, but I have no clue how to get that information so it can be provided.


How can I authenticate as the title/server so I can create this ticket? I can't figure out how to get the authentication context for a title entity, or better yet, even create or get a title entity. Documentation on this would be wonderful if you can provide any.

photonMatchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ivan Cai avatar image
Ivan Cai answered

Firstly, the CreateServerBackfillTicket API is designed to allow the server to find more players. So, the CreateServerBackfillTicket must be called by server.The entityToken in the request header of the CreateServerBackfillTicket API can be obtained by calling GetEntityToken. When players want to match multiplayer game via server creating server backfill ticket, they can send entitykey(entityid and entitytype) to the server. The EntityId is the unique id of the entity, the EntityType here should be title_player_account.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Alexander Klingel avatar image Alexander Klingel commented ·

When calling GetEntityToken, how are we supposed to know the entity id and key of the server? Or, are you saying that you pass in a player's entity, and that `GetEntityToken` is able to create a title entity for the server?

0 Likes 0 ·
Ivan Cai avatar image Ivan Cai ♦ Alexander Klingel commented ·

The entitykeys sent to the server are those of players that need to be matched on the server side. You need to call GetEntitytoken to get the title's entitykey instead of a player.

0 Likes 0 ·
Alexander Klingel avatar image
Alexander Klingel answered

@Ivan Cai how do I create a title entity that the server can use?

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ivan Cai avatar image Ivan Cai ♦ commented ·

You can directly call GetEntityToken and not set sessionticket in the request header for getting title's entitykey.

0 Likes 0 ·
Mars Tanumihardja avatar image Mars Tanumihardja Ivan Cai ♦ commented ·

Hi @Ivan Cai, I'm trying to call GetEntityToken to get the Title EntityToken, but I keep getting a 403:NotAuthorized and the errrorMessage "The claim was not allowed to perform the requested action based on the entity's access policy. Policy comment: By default, all requests are denied. If you expected this request to succeed, you may be missing a policy. See the permissions APIs in PlayFab's Admin Api to add a permission." I've set the X-SecreteKey to the TitleSecretKey. Not sure if I have to update the ENTITY GLOBAL TITLE POLICY to enable getting the Title EntityToken?

0 Likes 0 ·
Mars Tanumihardja avatar image Mars Tanumihardja Ivan Cai ♦ commented ·

I now realize what I was doing wrong, in the body of my request I was specifying the Entity instead of just an empty {}:
{
"Entity": "{

"Id": "(titleID)",

"Type": "title"

}

}

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.