身份验证-在会话和基于令牌的身份验证之间共享同一经过身份验证的用户

时间:2018-10-07 08:20:13

标签: laravel api session authentication token

我正在寻求实现auth系统-使用laravel 5.5(php),这是我的情况:

myApp
    |--> administration (web auth) -no problem i will use the session based auth-
    |
    |--> users have two parts
                |-->first part where there are forms, listing ...
                |-->api part (client space built with react) 

我主要关心的是如何在Web部件和api一个之间共享(以安全,最佳的方式)身份验证用户(相同)?

我有什么选择?

  

如果您需要更多说明,请随时询问,赞赏

1 个答案:

答案 0 :(得分:0)

您可以使用JWT身份验证。这是基于令牌的身份验证,对Web和API均有用。

您可以在https://jwt.io/introduction/

中找到更多信息

以下链接也可以为您提供帮助 https://laravel.com/docs/5.5/authentication https://laravel.com/docs/5.5/passport