登录
首页 >  文章 >  java教程

Using Honsole with Spring Security

来源:dev.to

时间:2024-07-09 16:10:03 181浏览 收藏

在文章实战开发的过程中,我们经常会遇到一些这样那样的问题,然后要卡好半天,等问题解决了才发现原来一些细节知识点还是没有掌握好。今天golang学习网就整理分享《Using Honsole with Spring Security》,聊聊,希望可以帮助到正在努力赚钱的你。

Using Honsole with Spring Security

If you've used the H2 console in Spring Boot (with or without Vaadin) before enabling Spring Security, you might have noticed that adding Spring Security blocks access to your database console. To fix this, the easiest way is to override the configure(WebSecurity web) method. Be careful with the method signature, as there is also a configure(HttpSecurity http) method, which won't help with this issue.

To regain access to your H2 console, you would typically do the following:

@Override 
protected void configure(WebSecurity web) throws Exception {
    web
        .ignoring()
        .requestMatchers(new AntPathRequestMatcher("/h2-console/**"));
    super.configure(web);
}

And that's all!

今天关于《Using Honsole with Spring Security》的内容介绍就到此结束,如果有什么疑问或者建议,可以在golang学习网公众号下多多回复交流;文中若有不正之处,也希望回复留言以告知!

声明:本文转载于:dev.to 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>