question

karan Sharma avatar image
karan Sharma asked

how to get player entity token from player entity in azure function?,How to get player entity token from player entity in azure function?

            PlayFabAuthenticationInstanceAPI AuthenticationInstanceApi = new PlayFabAuthenticationInstanceAPI(playfabProvidedContextData.ApiSettings, playfabProvidedContextData.AuthenticationContext);
           
            var damResult =await AuthenticationInstanceApi.GetEntityTokenAsync(new GetEntityTokenRequest
            {
                Entity = new PlayFab.AuthenticationModels.EntityKey
                {


                    Id = playfabProvidedContextData.CallerEntityProfile.Entity.Id,
                    Type = playfabProvidedContextData.CallerEntityProfile.Entity.Type
                }
            });


This is giving me error---

"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."
,
            PlayFabAuthenticationInstanceAPI AuthenticationInstanceApi = new PlayFabAuthenticationInstanceAPI(playfabProvidedContextData.ApiSettings, playfabProvidedContextData.AuthenticationContext);
           
            var damResult =await AuthenticationInstanceApi.GetEntityTokenAsync(new GetEntityTokenRequest
            {
                Entity = new PlayFab.AuthenticationModels.EntityKey
                {


                    Id = playfabProvidedContextData.CallerEntityProfile.Entity.Id,
                    Type = playfabProvidedContextData.CallerEntityProfile.Entity.Type
                }
            });

I get the playfab error from this----

"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."
entities
1 comment
10 |1200

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

karan Sharma avatar image karan Sharma commented ·

I didn't find any options to edit it or delete it so I can't do anything about it. its just duplicated twice. just read one of the part. apology for it

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

The problem is why you need to get a player’s entity token in Cloud Script? As Azure Function is hosted on headless servers, you may consider it is secure.

Many actions can be done from a server-level identity. You are able to get the entity token of a title to perform any actions you require. May I ask what’s the scenario?

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.