Remove “Using default security password” on Spring Boot

后端 未结 18 2177
小鲜肉
小鲜肉 2020-12-04 12:13

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.

Is there a

18条回答
  •  执笔经年
    2020-12-04 12:34

    Just use the rows below:

    spring.security.user.name=XXX
    spring.security.user.password=XXX
    

    to set the default security user name and password at your application.properties (name might differ) within the context of the Spring Application.

    To avoid default configuration (as a part of autoconfiguration of the SpringBoot) at all - use the approach mentioned in Answers earlier:

    @SpringBootApplication(exclude = {SecurityAutoConfiguration.class })
    

    or

    @EnableAutoConfiguration(exclude = { SecurityAutoConfiguration.class })
    

提交回复
热议问题