question

joshuakent27 avatar image
joshuakent27 asked

ExecuteFunction without the user logging in

Hi, I'm setting up the reset password functionality for a game I'm working on, and currently I have it set up on the client to let the user enter their email address and send the account recovery email, which is arriving without issue.

My problem is how to actually reset the password. I've done a lot of searching and it looks like it's recommended to implement this on a web server using the PlayFab Admin SDK. Unfortunately, I'm not much of a web developer, and I'm concerned this would take too long to implement. The website it would use is running on WordPress, and I've done a little research about how to get it working on the web server, but I have yet to find any solid answers and am still a little confused about the security of it, since the Admin API requires the title's secret key.

So I was hoping to use an Azure Function (as I've seen others suggest on here in multiple places) through cloudscript to reset the password. I got the Azure Function set up, published, and connected to PlayFab, but then I discovered that the ExecuteFunction API requires the EntityToken to be called, which I think means the user has to be logged in to use it, correct?

I'm really confused about how to reset a user's password via an Azure Function if the only way to call an Azure function is to have the user be logged in. I assume the only way is to have the client already connected to the server prior to being logged in, and to have the server run the ExecuteFunction API on behalf of the user, but I had no plans for making that client server connection prior to logging the user in.

Am I missing something? Why have I seen so many people recommend using Azure Functions for resetting passwords if this is a limitation?

apissdksCloudScript
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

·
Simon Cui avatar image
Simon Cui answered

PlayFab has provided a default password resetting web page now. When you request the client API SendAccountRecoveryEmail, if you choose not to pass the EmailTemplateId, PlayFab would send an email that contains a default resetting password page to the player’s email address which provided inside the request body.

The link in the email would navigate to a webpage that made by PlayFab. And players can reset the password on the webpage directly. For more information, please refer to this post: How to reset the password when an user forgot it in Unity app?

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.

joshuakent27 avatar image joshuakent27 commented ·

Thank you! I had no idea that PlayFab had that option that would take care of resetting the password without using an EmailTemplateId. I just tried it out and it worked great. Such a huge help!

1 Like 1 ·

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.