I'm attempting to create a matchmaking ticket for a player using Azure Functions/CloudScript.
Here's what I'm doing exactly:
First, I get an entity token as title from my secret key.
{ path: '/Authentication/GetEntityToken', options: { method: 'POST', body: '{"Entity":{"Id":"YYY","Type":"title"}}', headers: { 'Content-Type': 'application/json', 'X-SecretKey': 'XXX' } } }
Next, I call CreateMatchmakingTicket
{ path: '/Match/CreateMatchmakingTicket', options: { method: 'POST', body: '{"GiveUpAfterSeconds":10,"QueueName":"DefaultQueue","Creator":{"Entity":{"Id":"YYY","Type":"title_player_account"}}}', headers: { 'Content-Type': 'application/json', 'X-EntityToken': 'ZZZ } } }
Finally, I get this response:
{ path: '/Match/CreateMatchmakingTicket', result: { code: 403, status: 'Forbidden', error: 'MatchmakingEntityInvalid', errorCode: 2001, errorMessage: 'The entity of the caller must be one of types: title_player_account.' } }
What I can intuit from this is that it is unhappy with the fact that the X-EntityToken I am using is for a "title" and not a "title_player_account". I've attempted to acquire an EntityToken for a title_player_account using my title EntityToken and I get the following error:
{ path: '/Authentication/GetEntityToken', result: { code: 401, status: 'Unauthorized', error: 'NotAuthorized', errorCode: 1089, errorMessage: "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." } }
Am I approaching this the right way? Should I just make matchmaking tickets directly from the game client itself? Should I not even be bothering with proxying this to the server-side?