如果您在启用 Spring Security 之前在 Spring Boot 中使用过 H2 控制台(无论有或没有 Vaadin),您可能会注意到添加 Spring Security 会阻止对数据库控制台的访问。要解决此问题,最简单的方法是重写 configure(WebSecurity web) 方法。请注意方法签名,因为还有一个 configure(HttpSecurity http) 方法,这对解决此问题没有帮助。
要重新获得对 H2 控制台的访问权限,您通常需要执行以下操作:
@覆盖
protected void configure(WebSecurity web) 抛出异常 {
网络
.ignoring()
.requestMatchers(new AntPathRequestMatcher("/h2-console/**"));
超级配置(网络);
}
登录后复制
仅此而已!
以上就是将 Honsole 与 Spring Security 结合使用的详细内容,更多请关注php中文网其它相关文章! 

Anya142Sa1 天前
发表在:ASUS华硕A8N-SLI Deluxe主板BIOS 10110Hello friends! I c...
91资源网站长-冰晨14 天前
发表在:广告合作123
FrankFAT14 天前
发表在:10日14日,星期二,在这里每天60秒读懂世界!Big cocks of blacks ...
RichardGlymn20 天前
发表在:Java webservice多个参数怎么调用https://t.me/win_1_c...
Thomasstolo22 天前
发表在:Java webservice多个参数怎么调用https://t.me/s/Casin...
Thomasstolo22 天前
发表在:Java webservice多个参数怎么调用https://t.me/s/Offic...
Thomasstolo22 天前
发表在:Java webservice多个参数怎么调用https://t.me/s/Offic...
Thomasstolo22 天前
发表在:Java webservice多个参数怎么调用https://t.me/s/Offic...
Charlesbeise25 天前
发表在:10日02日,星期四,在这里每天60秒读懂世界!Get free Blockchain ...
WalterSnula1 个月前
发表在:Java webservice多个参数怎么调用https://t.me/s/Reyti...