question

mawiel avatar image
mawiel asked

Entity Access Policy - Error 1089 - NotAuthorized

Hello, Mawiel here! I am working on Matchmakig for my game made in Unreal Engine 4. So far I've setup a way for players to sign up for a queue using tickets, then reading back on the status of the matchmaking and finally getting a 'match' with an array of 'Members'. Now I am stuck on the part where I would get information from my other members so I can create the Party and Launch the instance for these players (this part is handled on my side). I am able to get back "MY" Playfab ID from the Title ID in the 'match results', going through GetEntityToken and GetProfile to be able to access the PlayFab ID which I will later use to get UserData and DisplayName. So, for other players than me, I get this error after calling 'GetEntityToken' :

ErrorCode=1089


ErrorName=NotAuthorized 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

I also tried to get it working without the GetEntityToken but that also gave an Not Authorized Error. Seems like I have to add permissions into the Admin API (ENTITY GLOBAL TITLE POLICY), to access the other Members Entity Info (PlayfabID, DisplayName) from the Match, I am not sure what I should specifically add to this list, any ideas?

Thanks!

10 |1200

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

1 Answer

·
Seth Du avatar image
Seth Du answered

GetEntityToken is an API used for retrieving Entity Token, which is different from Entity Key and is only for authentication or login.

The match members returned from the ticket should be title_player_account ID, you can use GetProfile/GetProfiles to get Player ID (which is also master_player_account ID)

And yes, if you want to call GetProfile in the client side, you may need to modify the ENTITY GLOBAL TITLE POLICY:

{ 
"Action": "Read", 
"Effect": "Allow", 
"Resource": "pfrn:data--*!*/Profile/*", 
"Principal": "*", 
"Comment": null, 
"Condition": null  
}

However, I will not suggest you to do it because it will give the players on the client too much information, hence please migrate the get information part to the Cloud Script where the entity token is set as title-level entity. You can retrieve and combine any information you want, then return to the client.

10 |1200

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

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.