小编Ema*_*ele的帖子

HttpSession为SPRING_SECURITY_CONTEXT返回了null对象

我正在尝试将Spring Saml库集成到示例Web应用程序中,使用Shibboleth作为IDP.我可以加载登录页面,登录并显示索引页面.

问题是,当我点击其他链接时,webapp会将我重定向到登录页面,然后IDP会识别我并重定向到所请求的页面(如果网络速度很快,则很难看到这一点).这就像我没有登录Spring安全性.

我检查了日志,发现了这个:

org.springframework.security.web.context.HttpSessionSecurityContextRepository - HttpSession为SPRING_SECURITY_CONTEXT org.springframework.security.web.context.HttpSessionSecurityContextRepository返回了null对象 - 没有来自HttpSession的SecurityContext:org.apache.catalina.session.StandardSessionFacade@fde8fb.将创建一个新的.

这是web.xml

<!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/spring/root-context.xml
        /WEB-INF/spring/security/securityContext.xml
    </param-value>
</context-param>
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<!-- Creates the Spring Container shared by all Servlets and Filters -->
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- Processes application requests -->
<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>



<!-- Custom error pages …
Run Code Online (Sandbox Code Playgroud)

spring spring-security opensaml saml-2.0 spring-saml

8
推荐指数
1
解决办法
1万
查看次数

Jenkins插件:以编程方式创建新作业

如何在插件中创建新的Jenkins作业?

我有一个Jenkins插件,它可以监听消息队列,当消息到达时,会触发一个新事件来创建一个新作业(或者开始一个运行).

我正在寻找类似的东西:

Job myJob = new Job(...);
Run Code Online (Sandbox Code Playgroud)

我知道我可以使用REST API或CLI,但由于我在插件中,我会使用java内部解决方案.

hudson jenkins jenkins-plugins

8
推荐指数
2
解决办法
5286
查看次数