Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Doronhn · Aug 07, 2018 at 05:52 PM · Player Dataunity3dAuthentication

understanding the authentication flow better, few questions

Hey all,

Thanks in advance for your help, your response time is great. but am working for like 20 hours on the all flow of the authentication and i read everything there is out there about the all API and etc.

My goal is to let my players the option to login with two types of login:

1. login with Facebok \ Google

2. login as a guest

- for both situation i want to create playfab account and link them to deviceID

the basic flow i had in mind is:
1. check if i keep local info about the user(last login method,PlayFab account and etc)

2. if he has info -> authenticate him via his provider (Facebok or Google) and authenticate him again via PlayFab (not sure i need that).

3. update my local info from his provider and update playfab as well

4. start play the game.

------

5. if i dont have info about the user, then show him the login screen and let him pick one of the types

6. then authenticate him via his provider (Facebok or google) and authenticate him again via PlayFab (not sure i need that).

7. create playfab account and save his data to local device

8. start play the game

i have few question that i want to be sure about them:

1. the flow i had in mind is make sense? is best practice? is ok?

2. how do i save the data on the deviceID?

3. why do i need playfab (if i save the data locally)?

thanks.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Aug 07, 2018 at 06:08 PM

Any login to PlayFab, for credentials that are not associated with an existing PlayFab account, will create a PlayFab account automatically if you have CreateAccount set to True. If you want to link the credentials to an existing PlayFab account, you would log into that account using the credentials already associated with it, and then use the appropriate Link... API call to link to it.

For your specific questions:

1. No, I would create the account using the Device ID first, then link Facebook/Google. This is described in our login best practices guide, here: https://api.playfab.com/docs/tutorials/landing-players/best-login.

2. I'm not sure what this means. You can save any data you like locally, and you can sign into PlayFab using the Device ID. For a signed-in PlayFab account, you can save data either insecurely, direct from the client, or your can send it up to a Cloud Script call so that you can write it to read-only user data, and have whatever cheat checks you need in the script.

3. For a start, so that you have a cloud save of the player account, for purposes of moving from device to device. But there's a massive range of reasons beyond that - our feature list (https://playfab.com/features/) would be something to review. In addition to essentials like receipt validation for mobile titles, we have a complete set of LiveOps tools you can use to maximize the potential of your games.

Comment

People who like this

0 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Doronhn · Aug 07, 2018 at 10:15 PM 0
Share

Thanks for the answer, i did try to read and understand the best login, and i did saw the Youtube series for authentication.

so if i understand you correctly, the flow should be like this-

1. user start my app for the first time

2. user select provider to authenticate

3. i save his details locally.

4. i send API request to PlayFab to create account for this device id

5. i send API request to PlayFab to link the device id \ account to the provider.

until now the flow is ok?

what happen if the user is log in again? what is the flow?

avatar image Brendan ♦♦ Doronhn · Aug 09, 2018 at 04:08 AM 0
Share

Or instead of 2, you could simply and invisibly sign the user in - creating an account if needed - using the Device ID (or, on PC, a generated GUID you save locally). That would let you get the player into the gameplay without stopping to decide which provider to use to log in.

When you create a PlayFab account using the Login... API calls, that credential is already linked to the account. You don't have to additionally call the Link... endpoint.

When the user logs back in, just re-use the Device ID to log them in.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Integrate my own server with Playfab's Multiplayer system 1 Answer

    Is it possible to authenticate two users from one device? 1 Answer

    Deleted players but the players are still there... 1 Answer

    Stay logged in when the scene changes 1 Answer

    1 xbox account linked to 2 playfab master accounts and unique names 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges