question

rocco@done-solo.com avatar image
rocco@done-solo.com asked

Link deviceIds to existing account without credentials/third party

Hello, I have seen multiple posts that linking different device Ids to the same Playfab-Playeraccount ist possible. That's great, but I don't understand how to achieve this without asking the user to authenticate via a third party service like Facebook or username/password credentials. 

My scenario is that a Player has  created an Playfab account automatically when he first starts the game on his iPhone - I think you call those accounts "partial" as they don't have a username set. 

Now the Player wants to use the very same playfab account on his iPad but he does not want to use an intermediate service like Facebook, Google, etc for authentication.  Instead he just wants to have his device id of the iPad linked to the same Playfab account originally created on his iPhone with the least efforts.

So my idea was that  on the new installation on iPad he would need to enter some sort of key.  I could generate that key from the existing Playfab-Userid and expose on his original iPhone installation. My game code on the iPad would then send the entered key to a handler in CloudScript and it would find the existing Playfab-Account and let's the client link his deviceId to that account.

That would be my idea, but is this possible? Does the API allow for that? Or is there another flow that works out? I am aware that everybody with the knowledge of the created key could in theory link any device to that game but this is a minor concern at the moment.

Thanks 

-act

 

10 |1200

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

brendan avatar image
brendan answered

You are correct - once you've created an account in PlayFab using one authentication system, you're going to have to sign into it in some way, to be able to link another authentication system to it. Once you've done that, signing in from either is simple and gets you to the same account, but setting it up to start requires a commonality of some kind.

And yes, you can use the Custom ID link API call to set up a "code" (generally speaking, a generated GUID) that the player would then enter, in order to connect to the account. So basically, the flow for your game would be:

  • Player creates an account using iOS
  • Player clicks the "generate code to sign in with another iOS device" option
  • This generates a GUID in the client, which you link to the account
  • The player enters the GUID in a special "sign in with code" screen in your game, which uses LoginWithCustomId to sign into the account
10 |1200

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

rocco@done-solo.com avatar image
rocco@done-solo.com answered

Awesome - thank you Brendan! I have in fact not thought about using LoginWithCustomId, this is exactly what I was looking for.

Best

-act

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.