I'm using laravel 5.2 to make an rest API for mobile apps. For authentication in the mobile apps they should only use Facebook login. So my question is how can i implement this rest api with facebook authentication.
I was thinking to make a users model at the server side and when a user logins with facebook from the app I get all the information for the user and save it in the users model, like name email photo ect. If the user is already registered in my users model I was thinking to get the users email address from facebook and compare it to users in my users model to get the users info.
According to accesstoken I was thinking to use JWT, but I'm not sure how? My solution could maybe be when a user login with facebook my api either save the user or get the user and then return and JWT token. Hope you guys understand my problem and can help me out - Thank you.