简体   繁体   English

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

[英]Auth - share the same authenticated user between session and token based auth

I'm looking to implement an auth systeme - working with laravel 5.5 ( php ) , this is my situation:我正在寻找实现身份验证系统- 使用 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)

My main concern is how to share (in a secure and best way) the auth user (same one) between the web part and api one?我主要关心的是如何在 web 部件和 api 之间共享(以安全和最佳方式)身份验证用户(同一用户)?

what options do i have ?我有什么选择?

If y need more clarification plz do not hesitate to ask, Any help is appreciated如果你需要更多的澄清请不要犹豫问,任何帮助表示赞赏

You can with for JWT Authentication.您可以使用 JWT 身份验证。 It is a token based authentication useful for both web and API's.它是一种基于令牌的身份验证,对 Web 和 API 都很有用。

You can find more at https://jwt.io/introduction/您可以在https://jwt.io/introduction/找到更多信息

& &

Also the following links may help you https://laravel.com/docs/5.5/authentication https://laravel.com/docs/5.5/passport以下链接也可以帮助您https://laravel.com/docs/5.5/authentication https://laravel.com/docs/5.5/passport

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

相关问题 Laravel同时获得Auth变量-基于API令牌和基于会话的身份验证 - Laravel get Auth variable for both - api token and session based authentication 使用laravel Auth进行社交身份验证的用户 - Socially authenticated user using laravel Auth Laravel Passport Auth::user 返回所有用户而不是经过身份验证的用户 - Laravel Passport Auth::user return all users instead of authenticated user laravel Auth :: user() - >返回所有不仅仅是经过身份验证的用户 - laravel Auth::user()->with return all not just authenticated user 如果Auth :: user()检索已通过身份验证的用户或为null,为什么还要使用Auth :: check()? - Why use Auth::check() if Auth::user() retrieves already authenticated user or null? Laravel 5.3 Auth Facade更改为默认的经过身份验证的用户 - Laravel 5.3 Auth facade is changing to a default authenticated user 无法使用Laravel 5.8和Auth0获得身份验证的用户 - Unable to get authenticated user using Laravel 5.8 and Auth0 是否可以在未经身份验证的路由上使用 Auth::user()? - Is it possible to use Auth::user() on non-authenticated routes? 基于 Laravel 会话的 auth:api 中间件不起作用 - Laravel session based auth:api middleware not working Auth :: logout()和Session :: flush()之间的区别 - Difference between Auth::logout() and Session::flush()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM