question

Sophie Consignado avatar image
Sophie Consignado asked

Bad request error 400 on login

I want to add username and password to existing accounts linked to facebook accounts, so that they can also login with username and password.

So I used the AddUsernamePasswordRequest. Im able to add the username, password and email. but when i try to login, i get a Bad Request error code 400. What do i do?

AddUsernamePasswordRequest request = new AddUsernamePasswordRequest {

            Email = pf_playerAccountInfo.PlayerPlayFabId + "@sophie.me",
            Username = pf_playerAccountInfo.PlayerDisplayName,
            Password = iFieldv.text
        };

        PlayFabClientAPI.AddUsernamePassword(
        request,
      	result => {
		// success

	},

        error =>

        {
        });



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

·
Sarah Zhang avatar image
Sarah Zhang answered

Actually you can’t call Client APIs in the CloudScript. Check this doc to learn about writing custom CloudScript. In most game designs, player should add username, Email and password by themselves. So you can let your players call this API in the clients after they logged in.

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.