question

Aybjax avatar image
Aybjax asked

Is it possible to download files of random players in playfab, without EntityToken but only with secret key?

We are saving player statistics in the form of json in the server. I am struggling to find solutions to retriving files with only secret key. In addition to that, even though I see payload of entity_files_set event in playstream monitor, I am struggling to get download url.

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

·
Sarah Zhang avatar image
Sarah Zhang answered

As our document -- Entity files shown, once you get the entity files’ downloading URLs, you can download the files through a simple GET request directly. For files download, the Entity Tokens is not required. So, your question is how to get the entity file’s downloading URLs without the Entity Tokens, is it right?

If so, since all Entity APIs need to be accessed by the Entity Token, you can’t call the Entity API GetFiles without the Entity Tokens. If you want to call the Entity APIs such as the API GetFiles on the server, you can use the title level’s Entity Token to access them. If you have set the Secret Key in the PlayFab settings, you can call the API GetEntityToken to get the title level Entity Token, so that you can access all Entity APIs on the server. If you have any detailed question about how to get the Title Entity Token, please feel free to let us know.

5 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.

Aybjax avatar image Aybjax commented ·

Thanks for you response. Wa really helpful.

I would like to ask details of the title entity token. Bevause to get entity token I need to have session ticket.

Using postman sdk, I could register and get tokens. However, I do not like server to register.

However, if I register with customId (registered as the_title_account), I am not authorized to get data (error code 1089). Even if I change Entity Global Title Policy for:

[ {

"Action": "*",

"Effect": "Allow",

"Resource": "*--*",

"Principal": "*",

"Comment": "",

"Condition": null

}] in the title settings.

it does not work.

In a way, is there any way to create "Master" account, that is like a admin that can have "unlimited power" :).

Thanks in advance.

In the title settings of developer.playfab.com, we can assign users roles and permission, but that permissions are only for website use.

0 Likes 0 ·
Aybjax avatar image Aybjax Aybjax commented ·

Request to https://{ {TitleId}}.playfabapi.com/Authentication/GetEntityToken?sdk=PostmanCollection-0.124.210521

body: { "Entity": { "id": "D5684575377642B4", "type": "title_player_account" } }

response: { "code": 403, "status": "Forbidden",

"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." }

0 Likes 0 ·
Aybjax avatar image Aybjax Aybjax commented ·


@Sarah Zhang

Headers:

X-Authorization: { {SessionTicket}} // from customId login

X-SecretKey: { {SecretKey}}

0 Likes 0 ·
Aybjax avatar image Aybjax Aybjax commented ·

Does not work. I must have written correcty that I updated global policy. I updated admin/getPolicy and admin/UpdatePolicy. But this does not work. That is why I have no authorization to change

I would like to update profiles/SetGlobalPolicy, but I get 403 status code. with error saying:

"Policy comment: By default, all requests are denied".

What should I do.

All I want (this and subsequently) to have the same admin rights as if we are using GameManager panel. Eg: to have access to files of any player just knowing their layfab id

0 Likes 0 ·
Show more comments

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.