question

Alexander Brady avatar image
Alexander Brady asked

How to unlink all custom ids from a user,How would you go about removing all custom Ids of a player with a cloudscript?

I want to make a cloudscript function that unlinks all custom ids from an user account. How would I go around doing this?

,

I want a user to log out of all devices after the password is reset, I already configured a rule to do ths, but not sure how to proceed. I currently have users logging in with custom ids, so I want to delete those.

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

Alexander Brady avatar image Alexander Brady commented ·

Sorry for the bad format, question sent twice.

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Currently, you can only retrieve the latest assigned CustomID via PlayFab API or Game Manager. PlayFab hasn’t provided a “List CustomIDs For The Player” API. The workaround is to let CloudScript access API UpdateUserReadOnlyData to store this CustomID as the Player Read-Only Data when the players link a CustomID. You can access Admin/Server/Client API GetUserReadOnlyData to get the corresponding K/V pairs.

Besides, PlayFab only provides the Client API UnlinkCustomID to unlink the related CustomId from the user’s PlayFab account. CloudScript can access all Server API sets, but cannot access the Client API. So, CloudScript is unable to access the API UnlinkCustomID by default.

For your case, we would recommend you let clients clear the credentials cache regularly, so the players need to enter the password frequently. This can enhance security and prevent users from forgetting passwords. Besides, whenever the player reset the password, you can set a flag such as “isResetPassword” in the Player Read-Only Data to mark this operation. Let players validate this flag after they log in. If this flag’s value is true, let clients unlink the current CustomIDs.

Except to use the above workaround, you can try to add a feature request to request the Server API such as “UnlinkCustomID” and “ListLinkedCustomIDsForThePlayer”.

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]