【问题标题】:SAML Spring Security session timeoutSAML Spring Security 会话超时
【发布时间】:2016-08-03 08:20:32
【问题描述】:

我已经配置了运行良好的 SAML SSO。当会话过期时,它会在日志中显示以下内容。

2017-04-15 15:14:16,933 [http-nio-7070-exec-8] INFO  org.springframework.boot.actuate.audit.listener.AuditListener - AuditEvent [timestamp=Sat Apr 15 15:14:16 IST 2017, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={message=Access is denied, type=org.springframework.security.access.AccessDeniedException}]
2017-04-15 15:14:17,035 [http-nio-7070-exec-8] INFO  org.springframework.security.saml.log.SAMLDefaultLogger - AuthNRequest;SUCCESS;0:0:0:0:0:0:0:1;com.hbo.sso:portal;http://www.okta.com/xxxxxxx;;;

这是我的 spring-security.xml

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:security="http://www.springframework.org/schema/security"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">

    <import resource="classpath*:applicationContext-saml.xml" />

    <security:http  entry-point-ref="samlEntryPoint" use-expressions="true">
       <security:intercept-url .... />
       /* Logging out user */
       <security:intercept-url pattern="/${myapp.logout.url}" access="permitAll()"/>
    </security:http>

</beans>  

【问题讨论】:

标签: spring-security saml spring-saml


【解决方案1】:

当会话过期时,您的 spring 会话会自动清除,因此它会抛出拒绝访问异常,解决方案可能是 1. 在您的 spring-security.xml 添加拒绝访问页面重定向详细信息.. 例如

<security:http > <security:access-denied-handler error-page="/anonymous/accessdeniedpage.jsp"/> </security:http> 要么 2. 如果您的 IDP 在会话超时时允许配置/重定向页面,则将其映射到您的登录页面。

【讨论】:

    猜你喜欢
    • 2014-05-04
    • 2016-12-05
    • 2018-09-27
    • 2014-10-18
    • 2015-12-27
    • 1970-01-01
    • 2015-12-10
    • 2011-07-20
    • 2014-10-29
    相关资源
    最近更新 更多