草庐IT

login_auth

全部标签

php - 拉维尔 4 : Stock Auth login won't persist across pages

从所有教程中,我应该能够对用户进行身份验证,然后跳转到任何其他页面,并保持登录。然而,这不起作用。自定义编译的PHPLAMP堆栈。应用存储是可写的。与教程的唯一区别是我使用的是电子邮件而不是用户名。http://laravelbook.com/laravel-user-authentication/http://codehappy.daylerees.com/authenticationsession有效,因为我能够将var存储到session并在不同的页面上读出它。models/User.php(股票)useIlluminate\Auth\UserInterface;useIllum

php - Laravel 5.2 -> 5.3 Auth::user() 返回 null

我已经从5.2升级到5.3,Auth::user()返回null。路线Route::group(['middleware'=>['auth']],function(){Route::get('/test','MyController@showMain');}Controller构造函数调用Auth::check()返回nullpublic$user;publicfunction__construct(){$this->user=Auth::user();}publicfunctionshowMain(){return$this->user;}ControllershowMain调用Au

php - laravel 护照 : Request user() returning null outside auth:api middleware, 和内部返回用户对象

当我尝试使用auth:api中间件获取登录用户的详细信息时,它会在我的Controller函数中返回包含详细信息的用户对象。api.php(withauth:apimiddlewarereturnsUserobject)Route::group(['middleware'=>'auth:api'],function(){Route::get('users/mentor_details/{uuid}','UserController@getMentorProfileDetails');});但是当我试图在这个auth:api中间件之外获取登录用户详细信息时,它返回null。api.php

php - FOSUserBundle - 如何在尝试访问 login_path 时重定向已经登录的用户

是否可以仅针对AUTHENTICATED的用户执行自动重定向到特定路由/login的某些路由(即/)?以及如何?我正在使用FOSUserBundle。这是我的安全配置:security:encoders:FOS\UserBundle\Model\UserInterface:sha512role_hierarchy:ROLE_ADMIN:ROLE_USERROLE_SUPER_ADMIN:ROLE_ADMINproviders:fos_userbundle:id:fos_user.user_provider.username_emailfirewalls:main:pattern:^/f

php - Laravel, Controller 中的 Auth::user()

Laravel框架-为什么我不能在Laravel项目的Controller中使用Auth::user()(查看用户是否已登录)。Session是否未连接到Controller?HomeController.phppublicfunctionisauthorized(){if(Auth::user()){returnView::make('home.basic')->with('basic1','Authorized');}else{returnView::make('home.basic')->with('basic1','NotAuthorized');}}我的登录系统正在运行,登录

php - Auth guard 驱动程序 [api] 未定义

我正在使用laravel5.4并使用jwtauthjwt版本是jwt-auth"tymon/jwt-auth":"0.5.*"在auth.php中我有'guards'=>['web'=>['driver'=>'session','provider'=>'users',],'api'=>['driver'=>'jwt','provider'=>'users',],],在Api.php中我有Route::post('/login','HomeController@authenticate');Route::group(['prefix'=>'v2','middleware'=>'auth:

php - CakePHP ACL 和 Auth 不工作

我有几个关于CakePHP的ACL和Auth系统的问题。acos表中别名的命名约定是什么?是“controllers/Posts/add”还是仅使用“Posts”中的父ID进行“添加”?我的登录无效。当我尝试登录时,我没有收到任何错误消息,但Auth.User和Auth->user('id')都是空的。可能是什么问题呢?我做的一切都像CakePHP的ACL示例中那样。谢谢。更新:我现在可以登录(服务器上的时间设置有问题),我的acos表看起来正确,但我无法执行任何操作。我允许aros_acos表中的操作。如果我使用'$this->Acl->check()'检查权限,如果我给出操作的单个

php - 更改 symfony2 login_check URL

我正在根据设定的规范实现Symfony2解决方案。规范规定GET/login处的登录表单必须恢复为POST/login。如何更改/login_check的URL?我可以创建一个直接调用安全Controller的路由,如下所示吗?我在安全包中没有看到任何Controller。oft_auth_login:pattern:/logindefaults:{_controller:MagicSecurityBundle:Default:login_check}methods:[POST]根据security.yml的文档,check_path(type:string,default:/logi

php - 如何在使用 Zend_Auth 进行身份验证后重定向到请求的 URI?

我正在使用一个简单的Zend_Auth设置为我的一个应用程序验证用户,使用controllerplugin中的preDispatch()方法检查.当匿名用户导航到/users/view/id/6例如,他们应该在认证后被重定向到上面的URI。最好的方法是什么?我不想在session中存储$_SERVER['REQUEST_URI']。就我个人而言,我发现将整个ZendRequest对象存储到最干净的解决方案中,但我不确定这是否明智以及我是否应该采用这种方法。有什么想法吗? 最佳答案 重定向或转发到LoginController可能不是

php - 重新请求拒绝的 Facebook 权限 (auth_type=rerequest) 不起作用

我们正在使用PHPSDK3.2.3和JavascriptSDK开发Facebook应用程序。如果用户在登录时拒绝访问在Facebook上发布,我需要重新请求用户允许在他们的墙上发布。作为documentation说:[...]Yourappmustre-askfordeclinedpermissionswithspecialhandling.[...][...]WebappsmustexplicitlypassanewoptiontotheLoginDialog:auth_type:rerequest.Detailsonhowthenewoptionworksonthewebiscov