question

Georgi Darakev avatar image
Georgi Darakev asked

LoginWithCustomID creates a new user when session expires and returns "no user found" if CreateAccount is set to false

If I wait until the session expires and call LoginWithCustomID a new user is created every time even though there is a user already using the same id. If CreateAccount is set to false "user not found" is returned.

Login code:

function DoExampleLoginWithCustomID() {

    PlayFab.settings.titleId = "TITLE_ID_REMOVED";

    var loginRequest = {

        // Currently, you need to look up the correct format for this object in the API-docs:

        // https://api.playfab.com/documentation/Client/method/LoginWithCustomID

        TitleId: PlayFab.settings.titleId,

        CustomId: "GettingStartedGuide",

        CreateAccount: true

    };

    PlayFabClient.LoginWithCustomID(loginRequest, LoginCallback);

}

First Output:

Congratulations, you made your first successful API call!

Test Running!

Datetime: Mon Jul 23 2018 20:26:33 GMT-0700 (PDT)

Playfab ID: 1DB9348EE6AA4F66

Second output. Same code later time.

Congratulations, you made your first successful API call!

Test Running!

Datetime: Mon Jul 23 2018 21:50:21 GMT-0700 (PDT)

Playfab ID: 73F46317BFFA3AA2

If CreateAccount is set to false and the session is over "User not found" is returned even though the CustomID never changes.

Authentication
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

·
brendan avatar image
brendan answered

I just tested using a Custom ID that's linked to an account that hasn't signed in for ages on my test account (months, really), and it logged into that account, no problem. Looking at your title, it's hard to say what's happening exactly, but we have a tremendous number of titles using Custom ID login, and the code path is actually the same regardless of whether you logged in within the last 24 hours, so it's not clear what exactly it is you're seeing. It is the case that if you unlink the Custom ID, a new account would be created. But in your title, there's actually only one PlayFab ID with that Custom ID attached - the others are an error in the Game Manager, showing out-of-date info. Can you provide any additional info for your repro?

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

Georgi Darakev avatar image Georgi Darakev commented ·

I made a test app and this is what I see in the Game Manager from the last 24 hours.

I was using the example unity login:

 var request = new LoginWithCustomIDRequest { CustomId = "GettingStartedGuide", CreateAccount = true};
 PlayFabClientAPI.LoginWithCustomID(request, done, OnLoginFailure);

This is the only call the test makes to Playfab and I did not delete or unlink any accounts from the panel.

0 Likes 0 ·
players.png (118.1 KiB)
players.jpg (89.9 KiB)
brendan avatar image brendan ♦♦ Georgi Darakev commented ·

So again, there's an issue in the Game Manager (for which we have a bug open) where it is showing the Custom ID linked in some cases where it is no longer linked. We'll have that fixed as soon as we can. For your issue, can you provide a specific repro case, using Postman? That is, using the Postman tool, can you create a player account using a Custom ID, and then on trying to log into that account, have it create a new account instead? If so, can you please provide the specific steps of your repro - again, using only the Postman tool, and please provide the specifics of each call (the values passed into the parameters).

0 Likes 0 ·

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.