如何在Spring中删除auth请求?

Dra*_*tis 6 java spring hibernate spring-mvc

在此输入图像描述

这条消息说:Required authorization. To access on the server http://localhhost:8080 you should enter login and password. Server message: Spring.

我正在使用Hibernate 4,Spring 4和Gradle.另外,我正在使用Spring Boot.但即使我从教程中获得了平面代码,也会出现此消息.是什么引起了它以及如何摆脱它?怎么了?控制台中没有错误消息.

Dee*_*ari 15

security properties在您的项目中搜索并设置

security.basic.enabled=false
Run Code Online (Sandbox Code Playgroud)

http://docs.spring.io/spring-boot/docs/1.1.8.RELEASE/reference/htmlsingle/#howto-switch-off-spring-boot-security-configuration

检查上面链接中的66.1.

来自Doc:如果在应用程序的任何位置使用@EnableWebSecurity定义@Configuration,它将关闭Spring Boot中的默认Webapp安全设置