TradecraftIT / mobile-app-controller

Backend, web services, and database for FanMobi
0 stars 0 forks source link

Update Login method #38

Open tonyalletag opened 9 years ago

tonyalletag commented 9 years ago

The artist will authenticate with Facebook locally, and the resulting token will be passed to the server to verify and pull the user's Facebook ID and name from. That FBID will be the primary token for artists.

1.  User opens the app. A musical artist has the option of logging in via FB.
2.  Login succeeds, and FB returns an access token to the app.
3.  App calls /login sending this access token as the sole parameter.
4.  Server calls https://graph.facebook.com/me?fields=id&access_token=<accesstoken>
5.  That call returns to the server:
        -Error (most likely an invalid access token).
             -Server in turn sends an error back to the app.
        -Success
             -Server pulls the Facebook ID from the successful response and either finds an existing Artist with that ID or creates a new Artist.
             - In either case, the server returns to the app an auth-token tied to this Artist for the app to use in the header of future calls.