Search Unity

Simple Authentication Question

Discussion in 'Multiplayer' started by JeffWScott, Apr 7, 2014.

  1. JeffWScott

    JeffWScott

    Joined:
    Mar 27, 2014
    Posts:
    12
    Hey guys, I'm so sorry if this question has been answered, but I can't find an answer to my specific question.

    I want to setup a database that stores information for an asynchronous turn based game.
    I do not want to have to manage passwords (encryption and resetting, etc).

    The Question is: What is the methodology around getting players to authenticate to your database (ie. create a new account) but using something like Google+, Facebook, MS Account, OpenID to actually do the authentication?

    In my mind the user would click either Google+ or Facebook buttons (like I have seen in other games), they would authenticate though that service, and then I would have access to their e-mail address. I would use the e-mail address as their unique identifier and then I would have them create a username. Am I on the right track, or is it easier then all that? What's the workflow after that when they need to login again?

    Any information would be super helpful as I try and plan for this.. like a blog, or forum post or a tutorial.. anything really.
     
  2. piluve

    piluve

    Joined:
    Mar 17, 2012
    Posts:
    158
  3. JeffWScott

    JeffWScott

    Joined:
    Mar 27, 2014
    Posts:
    12
    Thank you!
     
  4. JeffWScott

    JeffWScott

    Joined:
    Mar 27, 2014
    Posts:
    12
    Okay, so I think I have the work-flow kind of figured out for this. But I still have one question on the topic.

    If I have the user logon using Facebook Connect, and I use Facebook Connect to tell me who the user is, what unique identifier am I getting back from Facebook to tie into my Database?

    I'd like to get their e-mail address from Facebook then I can tie that to a username in my database, but what happens if that user changes their e-mail address with Facebook? The next time they go to login to my game I will have no record of them.

    So should I be using the oAuth token?

    Am I over complicating this :).

    Please help.
     
  5. JeffWScott

    JeffWScott

    Joined:
    Mar 27, 2014
    Posts:
    12
    I may have stumbled upon my own answer...

    The Facebook API returns {id:} which is a facebook specific unique identifier. So I would store that in my database and tie it to an app specific username...

    Right... . . ? right.
     
  6. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066