question

Kim Strasser avatar image
Kim Strasser asked

What can I do if the player forgot his username?

I use LoginWithPlayFab to login the player:

var result = await PlayFabClientAPI.LoginWithPlayFabAsync(new LoginWithPlayFabRequest()
{
    TitleId = titleid,
    Username = username,
    Password = password
});

What can I do if the player can not login because he/she forgot his username? Is it possible to send a recovery email with the username to the players login/contact email address?

Would it be possible to use admin API SendAccountRecoveryEmail in Azure Functions to send the recovery email with the username?

Account Management
10 |1200

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

Rick Chen avatar image
Rick Chen answered

If the player have an email registered under the PlayFab account, he can login with the email using LoginWithEmailAddress API. Then the username could be retrieved using GetAccountInfo API. Or, the player can contact the admin, and the admin can go to [Game Manager]->[Your Title]->[Players], and search a player’s account info that contains the Username by the Email, PlayFabId or TitleDisplayName.

The API SendAccountRecoveryEmail requires the player to have a contact email, which is a different property from PlayFab login email. This API can only allow players to change their password with the contact email address, not username.

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

Kim Strasser avatar image Kim Strasser commented ·

I use this code in Azure Functions to send a recovery email to the contact email address when the player has forgotten his password:

var request = new SendAccountRecoveryEmailRequest();
request.EmailTemplateId = "92F8DABB6183A281";
request.Email = contactaddress;
var resultsendemail = await adminAPI.SendAccountRecoveryEmailAsync(request);

Then the player receives the following email. But the problem is that the username is missing in the email:

Would it be possible to send this recovery email with the players username?

For example:

Hello "username",

You recently requested a password reset with us.


Please click here to be directed to a page to reset your password. Thanks!

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Kim Strasser commented ·

It is not possible to display the username in a recovery email, even if an email template is used.

If you would like to have this feature, please post a thread in Feature Request Forum.

0 Likes 0 ·
Kim Strasser avatar image Kim Strasser Rick Chen ♦ commented ·

I found out that someone already created a feature request: https://community.playfab.com/idea/4957/include-username-in-password-reset-email.html

0 Likes 0 ·
scottadams avatar image
scottadams answered

If they put an email on their account it will be unique. The contact email doesn't have to be unique; this is the account email.

Aassumng they have an account email, you can let them log in with their account email instead of their username.

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.