【问题标题】:Ignoring path in WebSecurity config in Spring在 Spring 中忽略 WebSecurity 配置中的路径
【发布时间】:2018-04-01 16:01:04
【问题描述】:

我有配置

@Override
public void configure(WebSecurity web) throws Exception {
        web
            .ignoring()
            .antMatchers("/base/**");
}

我想包含所有路径的视图,只是这条路径/base/includepath

我该怎么做?

【问题讨论】:

  • 你的配置是正确的,它包含你的要求!什么问题?
  • 我不想忽略路径/base/includepath。现在这个配置忽略了/base/上的所有路径。
  • 我想这就是你要找的东西 - stackoverflow.com/questions/29328120/…

标签: java spring websecurity


【解决方案1】:

如果您想从身份验证中排除 url(如 /base/includepath),您只需执行如下操作:

@Override
public void configure(WebSecurity web) throws Exception {
    web.ignoring().antMatchers("/base/includepath");
} 

我希望这就是你要找的。​​p>

【讨论】:

  • 不,我想排除所有其他路径,减去/base/includepath
猜你喜欢
  • 2016-11-04
  • 2017-06-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-25
  • 2012-06-26
  • 2021-11-22
  • 1970-01-01
相关资源
最近更新 更多