question

egemenyildirim1 avatar image
egemenyildirim1 asked

There is a bug in the AddUsernamePassword method.

When associating my account, which I logged in with a custom ID, with AddUsernamePassword, there is a very interesting email parameter bug. For example, my address is xxxxx@gmail.com, it registers without any problem. xxxxx1@gmail.com is also accepted without any problem. However, if there is a dot in the email address like xx.xxx@gmail.com, it gives an "Invalid Input Parameters" error.

If I use the RegisterPlayFabUser method, it accepts my email even if it is xx.xxx@gmail.com. This should also be the case in AddUsernamePassword.

The paramaters are all string.

I tested the code as follows: public void LinkAccountWithEmail(string email, string password) { string username = GetUsernameFromEmail(email); Debug.Log("Email type: " + email.GetType() + ", value: " + email); Debug.Log("Password type: " + password.GetType() + ", value: " + password); Debug.Log("Username type: " + username.GetType() + ", value: " + username); var linkRequest = new AddUsernamePasswordRequest { Email = email, Password = password, Username = username };

         PlayFabClientAPI.AddUsernamePassword(linkRequest, result =>
         {
             PlayerManager.instance.SetSections();
             LoginUser(email, password);
         }, error => {
             uiManager.ShowText(uiManager.ErrorText, error.ErrorMessage);
         });
     }
apis
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

·
Xiao Zha avatar image
Xiao Zha answered

I cannot reproduce your issue if I use email like this xxx.xxx@gmail.com, the AddUsernamePassword and RegisterPlayFabUser Apis work fine. And as https://en.wikipedia.org/wiki/Email_address says, dot can be used in email addresses, provided it is not the first or last character, and provided it does not appear consecutively. This is also consistent with my test results. In addition, the “invalid input parameter” error message will also occur when the UserName contains invalid characters such as “_”. You may double check the Email and Username parameters in AddUsernamePassword API request.

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.