简体   繁体   中英

Android app custom user registration and login with cookie using facebook sdk

I am developing an android application in which users need to register and log in using Facebook.

Approximately, this would be the flow.

Open the app for the first time, authenticate with Facebook, get their data, send the data to my server to create them an account in my application, start session with their new account in my server, get a cookie to perform later interactions.

So far so good.

What I need to know is wich data i have to send to my server, so i can be able to identify the users when they log in for the seccond time. This is because i need to start session in my server and send a cookie to the android app to do the further interactions. I'm using PHP as server side language.

I was thinking about getting the getAccessToken() in the android facebook sdk, then pass it to my server on the account creation and storing it in my android app.

But i can't manage how to do it to login the users on the second time they use the app.

Any suggestions ? Thanks in advance !

To uniquely identify the user within your app, you should make a request to /me and get the user's id. This is guaranteed to be unique and remain constant for your user/app combination.

The access token is not guaranteed to remain constant.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM