删除“使用默认安全密码"在Spring Boot上 [英] Remove "Using default security password" on Spring Boot

查看:369
本文介绍了删除“使用默认安全密码"在Spring Boot上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Spring Boot的应用程序中添加了一个自定义安全配置,但是有关使用默认安全密码"的消息仍在LOG文件中.

I added one custom Security Config in my application on Spring Boot, but the message about "Using default security password" is still there in LOG file.

有什么要删除的吗?我不需要此默认密码.看来Spring Boot无法识别我的安全策略.

Is there any to remove it? I do not need this default password. It seems Spring Boot is not recognizing my security policy.

@Configuration
@EnableWebSecurity
public class CustomSecurityConfig extends WebSecurityConfigurerAdapter {

    private final String uri = "/custom/*";

    @Override
    public void configure(final HttpSecurity http) throws Exception {
        http.csrf().disable();
        http.headers().httpStrictTransportSecurity().disable();
        http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);

        // Authorize sub-folders permissions
        http.antMatcher(uri).authorizeRequests().anyRequest().permitAll();
    }
}

推荐答案

我找到了关于排除 SecurityAutoConfiguration 类的解决方案.

I found out a solution about excluding SecurityAutoConfiguration class.

示例:

@SpringBootApplication(exclude = {SecurityAutoConfiguration.class })
public class ReportApplication {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(MyApplication.class, args);
    }
}

这篇关于删除“使用默认安全密码"在Spring Boot上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆