Pregunta

I am new to Laravel and it looks like a nice PHP framework. Going through the guide and various tutorials, I know how to login a user using the Auth class. However the Auth class requires a username and a password to login the user.

Now, if I am using Facebook Connect, after a successful authentication with facebook, I might be able to retrieve the user's details corresponding to the facebook ID I will have saved in the DB. However, for a facebook user, no passwords would be saved in the DB. So how do I log in the user with the Auth class?

In Codeigniter, I would have set the session data as follows:

$userdata = array(
    'logged_in' => true,
    'user_id' => $user_id
);
$this->session->set_userdata($userdata);
¿Fue útil?

Solución

Here's a guide of how to do it and also a bundle what will allow you to connect your users with more oauth apis

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top