Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oauth 2: Is access_token a unique key for User?

After a user connects with Facebook, Facebook responds with an access_token.

Can I assume this access_token will always stay the same and is unique for every user?

If so, then I can use it to find the user in my database, and if not found, create a new user.

If not, is there a way to ask Facebook to also send you back user_id (with the access_token) right after connecting so that I don't have to make another request to /me?fields=id for it?

like image 430
Jack Avatar asked May 18 '11 21:05

Jack


1 Answers

You should use their id as a unique identifier. The access_token is unique, but you'll get a new one every time you request one.

like image 92
Gray Avatar answered Sep 23 '22 01:09

Gray