This message says: Required authorization. To access on the server http://localhhost:8080 you should enter login and password. Server message: Spring
.
I'm using Hibernate 4, Spring 4 and Gradle. Also, I'm using Spring Boot. But this message appears even if I have got plane code from tutorial. What caused it and how to get rid of it? What's wrong? No error messages in console.
To disable Security Auto-Configuration and add our own configuration, we need to exclude the SecurityAutoConfiguration class from auto-configuration. If you have spring-boot-actuator included in your dependecies then you need to exclude ManagementWebSecurityAutoConfiguration class from auto-configuration.
If you find that specific auto-configure classes are being applied that you don't want, you can use the exclude attribute of @EnableAutoConfiguration to disable them. If the class is not on the classpath, you can use the excludeName attribute of the annotation and specify the fully qualified name instead.
In the basic authentication, we send a username and password as part of our request. When we provide a username and password, it allows us to access the resource. There are other advanced forms of authentication like digest authentication, where the password digest is created, and the digest is sent across.
Search for security properties
in your project and set
security.basic.enabled=false
http://docs.spring.io/spring-boot/docs/1.1.8.RELEASE/reference/htmlsingle/#howto-switch-off-spring-boot-security-configuration
Check 66.1 in above link.
From Doc: If you define a @Configuration with @EnableWebSecurity anywhere in your application it will switch off the default webapp security settings in Spring Boot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With