question

twhlynch avatar image
twhlynch asked

How to disable API endpoints

I have looked through other questions and docs and cant find one that actually works. All i want to do is disable a specific endpoint.

Examples that i currently have (that dont work)

Login With Custom ID. { "Resource": "pfrn:api--/Client/LoginWithCustomID", "Action": "", "Effect": "Deny", "Principal": "", "Comment": "Deny client access to LoginWithCustomID" }

Register PlayFab User { "Resource": "pfrn:api--/Client/RegisterPlayFabUser", "Action": "", "Effect": "Deny", "Principal": "", "Comment": "Deny client access to RegisterPlayFabUser" }

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

twhlynch avatar image twhlynch commented ·

I would also like to mention that in the api reference the example to deny an endpoint is as follows.

 {
         "Resource": "pfrn:api--/Server/DeleteCharacterFromUser",
         "Action": "",
         "Effect": "Deny",
         "Principal": "",
         "Comment": "Disable server character delete"
     }
0 Likes 0 ·

1 Answer

·
Neils Shi avatar image
Neils Shi answered

Please note that the Action and Principal fields require to be set. For more info, please refer to API Access Policy - PlayFab | Microsoft Learn. And you can refer to my test example:

         {
             "Resource": "pfrn:api--/Client/LoginWithCustomID",
             "Action": "*",
             "Effect": "Deny",
             "Principal": "*",
             "Comment": "Disable clinet LoginWithCustomID"
         },
         {
             "Resource": "pfrn:api--/Client/RegisterPlayFabUser",
             "Action": "*",
             "Effect": "Deny",
             "Principal": "*",
             "Comment": "Disable clinet RegisterPlayFabUser"
         }
4 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.

twhlynch avatar image twhlynch commented ·

I got the error: Failed to save new global policy: Invalid action * in statement.

0 Likes 0 ·
twhlynch avatar image twhlynch commented ·

ENTITY GLOBAL TITLE POLICY gave the following error:

Failed to save new global policy: Invalid action * in statement.

0 Likes 0 ·
twhlynch avatar image twhlynch commented ·

Didn’t work, I got an error saying * is an invalid value. (side note, I have commented this 4/5 times and my comment never sends.)

0 Likes 0 ·
Neils Shi avatar image Neils Shi twhlynch commented ·

The Global Title Policy and API Access Policy are two different things. You should use the UpdatePolicy API to change the API Access Policy. For more info, please refer to API Access Policy - PlayFab | Microsoft Learn.

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.