Spring安全性-使用会话/用户属性来限制访问?

Spring安全性-使用会话/用户属性来限制访问?,spring,spring-security,spring-session,Spring,Spring Security,Spring Session,我们正在尝试为web应用程序构建一个“锁定屏幕”,该应用程序使用不同的方式重新登录(短PIN而不是密码)。我们的想法是在用户模型中保存会话属性或其他内容,以表示用户被“锁定” 我们可以在SecurityConfiguration中做些什么来帮助您吗?大致如下: .anyRequest().hasSessionAttribute(“锁定”) 我们当前的SecurityConfiguration.configure()看起来有点像这样,仅供参考: @覆盖 受保护的无效配置(HttpSecurity

我们正在尝试为web应用程序构建一个“锁定屏幕”,该应用程序使用不同的方式重新登录(短PIN而不是密码)。我们的想法是在用户模型中保存会话属性或其他内容,以表示用户被“锁定”

我们可以在SecurityConfiguration中做些什么来帮助您吗?大致如下:

.anyRequest().hasSessionAttribute(“锁定”)
我们当前的SecurityConfiguration.configure()看起来有点像这样,仅供参考:

@覆盖
受保护的无效配置(HttpSecurity http)引发异常{
http.csrf().disable()
.授权请求()
.antMatchers(“/foo/**”和“/bar/**”).hasRole(“经理”)
.antMatchers(“/baz/**”).hasAnyRole(“经理”,“默认值”)
.antMatchers(“/css/**”和“/js/**”).permitAll()
.anyRequest().authenticated()
.及()
.formLogin()
.login页面(“/login”)
.loginProcessingUrl(“/login”)
.defaultSuccessUrl(“/”)
.permitAll()
.及()
.logout()
.permitAll()
.及()
.exceptionHandling().accessDeniedHandler(accessDeniedHandler);
}
完全卡住了,希望指针指向正确的方向