报错:This generated password is for development use only. Your security configuration must be updated before running your application in production.

项目报错:This generated password is for development use only. Your security configuration must be updated before running your application in production.

导致postman测试接口时报错:

401Unauthorized
Similar to 403 Forbidden, but specifically for usewhen authentication is possible but has failed ornot yet been provided.The response mustinclude a WWW-Authenticate header fieldcontaining a challenge applicable to therequested resource.

原因:springboot默认携带了一个springsecurity 密码

解决方法:在启动类上加上 SecurityAutoConfiguration.class

@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})

posted @ 2023-08-02 17:14  夏往  阅读(3510)  评论(0)    收藏  举报