Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove auth request in Spring?

enter image description here

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.

like image 371
Dracontis Avatar asked Oct 14 '14 13:10

Dracontis


People also ask

How do I turn off authorization in Spring Security?

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.

How do I exclude Spring Security 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.

What is basic auth in spring?

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.


1 Answers

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

like image 79
Deepu--Java Avatar answered Oct 20 '22 21:10

Deepu--Java