简体   繁体   English

Laravel Oauth2登录

[英]Laravel Oauth2 Login

I'm adding OAuth2 login to a Laravel 5 site to login using Facebook, Google and Twitter. 我将OAuth2登录名添加到Laravel 5网站,以使用Facebook,Google和Twitter登录。

By default, the Laravel login has a users table with fields for name, email, password etc. 默认情况下,Laravel登录名具有一个用户表,其中包含名称,电子邮件,密码等字段。

I want users to be able to sign up and login using their email as standard but also using OAuth2. 我希望用户能够使用其电子邮件作为标准注册和登录,也可以使用OAuth2。

I'm just a little confused about how to store the details passed back (eg Name, facebook/google ID). 我对如何存储传回的详细信息(例如名称,facebook / google ID)有些困惑。 Do I store these in the users table without a password but add an additional field to say whether they've logged in via OAuth?? 是否在不使用密码的情况下将它们存储在用户表中,但添加其他字段来说明他们是否已通过OAuth登录? Or should I create a seperate table for users that signup and login via OAuth? 还是应该为通过OAuth进行注册和登录的用户创建单独的表?

Thanks 谢谢

Not sure what you are using for oauth but have a look at : 不确定您用于oauth的内容,但请查看:

https://github.com/adamwathan/eloquent-oauth https://github.com/adamwathan/eloquent-oauth

Really simple to use - you can use the existing user table, no need to create a separate one. 使用真的很简单-您可以使用现有的用户表,而无需创建单独的表。

Hope that helps! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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