2016-12-27 81 views
-1

我想要做的事情是排除/my-path从Spring安全检查的任何检查请求。问题是我有一条路径/my-path。此路径的请求不应更新Spring会话中的上次访问时间。 请求传递的方式是通过SecurityContextPersistenceFilter,其中过滤器通过SecurityContextRepository加载上下文。 SecurityContextRepository获得会话,该会话更新上次访问的时间。 所以问题是:是否可以从任何会话检查中排除/my-path上的请求?春季安全春季会议:如何禁止更新会话最后访问时间为特定请求

回答

1
<http pattern="/my-path" security="none"/> 

或Java配置

web.ignoring().antMatchers("/my-path");