Auth认证退出失效的标题_php实例_脚本之家,SSO单点登入风度翩翩

签到不荒谬,然则退出的时候并不曾清掉session,退出后要么处于登陆境况。消除措施如下:

标题1:
小编登入了client2,又登入了client3,以往自个儿把client2退出了,在client3里面小编F5刷新了刹那间,结果页面报错:

路由如下

未可以见到辨识出指标 ‘ST-41-2VcnVMguCDWJX5zHaaaD-cas01.example.org’票根

Route::group(['namespace' => 'Admin', 'middleware' => 'auth'], function() { Route::resource('admin/post', 'PostController');});// 登陆Route::get('auth/login', 'AuthAuthController@getLogin');Route::post('auth/login', 'AuthAuthController@postLogin');// 5.2版本这里的方法需要写成logout,因为在中间件中是这么定义的public function __construct() { $this->middleware($this->guestMiddleware(), ['except' => 'logout']); } // 路由中的方法要跟上述一致Route::get('auth/logout', 'AuthAuthController@logout');

难点2:登陆了client,然后退出,再重新输入顾客名,结果页面也会报错 验证
‘ST-41-2VcnVMguCDWJX5zHaaaD-cas01.example.org’退步

AuthController.php中的

 

// 登录成功后跳转地址protected $redirectTo = 'admin/post';// 退出后跳转地址protected $redirectAfterLogout = 'auth/login';

化解措施:自身测量试验了多遍并在英特网做了参谋后校订,最后证实成功,之后就不报错了。化解办法如下:

参考

单点登出,客商端配置。笔者尝试利用SAML作为注脚和Ticket校验,不过调节和测验时意识单点登出取标记的章程只好识别CAS的评释和校验。
认证:org.jasig.cas.client.authentication.AuthenticationFilter
校验:org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter
过滤器顺序:

调理进度中在AppserviceProvider的boot方法里加多输出sql也会变成相通的大谬不然,所以在签到调节和测量检验时,尽量不要这么做

  1. CAS Single Sign Out Filter
  2. CAS Validation Filter
  3. CAS Authentication Filter
  4. CAS HttpServletRequest Wrapper Filter
  5. CAS Assertion Thread Local Filter
    特别注意Validation在Authentication在此之前,因为笔者动用的是Cas20ProxyReceivingTicketValidationFilter。
 /** * Bootstrap any application services. * * @return void */ public function boot() { // DB::listen { // dump; }

依据CAS文书档案描述:If you are using proxy validation, you should map the
validation filter before the authentication filter.

如上那篇灭亡Laravel5.2
Auth认证退出失效的难题正是笔者分享给我们的全部内容了,希望能给大家三个参照,也期望咱们多都赐教脚本之家。

 1  <!--   /****cas配置******/ -->
 2 
 3 <filter>
 4     <filter-name>characterEncodingFilter</filter-name>
 5     <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
 6     <init-param>
 7         <param-name>encoding</param-name>
 8         <param-value>UTF-8</param-value>
 9     </init-param>
10 </filter>
11 <filter-mapping>
12     <filter-name>characterEncodingFilter</filter-name>
13     <url-pattern>/*</url-pattern>
14 </filter-mapping>
15 <!-- 与CAS Single Sign Out Filter配合,注销登录信息 -->
16 <listener>
17 <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
18 </listener>
19 <!-- CAS Server 通知 CAS Client,删除session,注销登录信息 -->
20 <filter>
21 <filter-name>CAS Single Sign Out Filter</filter-name>
22     <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
23 </filter>
24 <filter-mapping>
25     <filter-name>CAS Single Sign Out Filter</filter-name>
26     <url-pattern>/*</url-pattern>
27 </filter-mapping>
28 
29 <!-- CAS Client向CAS Server进行ticket验证 -->
30 <filter>
31     <filter-name>CAS Validation Filter</filter-name>
32     <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
33     <init-param>
34         <param-name>casServerUrlPrefix</param-name>
35         <param-value>http://cas.youjiao.tjxddfdfqjy.com/cas</param-value>
36     </init-param>
37     <init-param>
38         <param-name>serverName</param-name>
39         <param-value>http://xxpt.yodfdfujiao.tjxqjy.com</param-value>
40     </init-param>
41 </filter>
42 
43 <filter-mapping>
44     <filter-name>CAS Validation Filter</filter-name>
45     <url-pattern>/system/login/fm.jsp</url-pattern>
46 </filter-mapping>
47 
48 <!-- 登录认证,未登录用户导向CAS Server进行认证 -->
49 <filter>
50     <filter-name>CAS Filter</filter-name>
51     <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
52     <init-param>
53         <param-name>casServerLoginUrl</param-name>
54         <param-value>http://cas.youjiao.tjxqjdcfdy.com/cas/login</param-value>
55     </init-param>
56     <init-param>
57         <param-name>serverName</param-name>
58         <param-value>http://xxpt.youdfdjiao.1tssjxqjy.com</param-value>
59     </init-param>
60 </filter>
61 <filter-mapping>
62     <filter-name>CAS Filter</filter-name>
63     <url-pattern>/system/login/fm.jsp</url-pattern>
64 </filter-mapping>
65 
66 <!-- 封装request, 支持getUserPrincipal等方法 -->
67 <filter>
68     <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
69     <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
70 </filter>
71 <filter-mapping>
72     <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
73     <url-pattern>/*</url-pattern>
74 </filter-mapping>
75 <!-- 存放Assertion到ThreadLocal中 -->
76 <filter>
77     <filter-name>CAS Assertion Thread Local Filter</filter-name>
78     <filter-class>org.jasig.cas.client.util.AssertionThreadLocalFilter</filter-class>
79 </filter>
80 <filter-mapping>
81     <filter-name>CAS Assertion Thread Local Filter</filter-name>
82     <url-pattern>/*</url-pattern>
83 </filter-mapping>

如此安插今后基本就一蹴而就这一个主题素材了。

发表评论

电子邮件地址不会被公开。 必填项已用*标注