GeekySelene
GeekySelene

Reputation: 927

Authentication required. http://localhost:8080 requires a username and password in Tomcat

I am creating a war file using Maven build and tried to deploy on the localhost Tomcat 8 server.

When I try to run the war, got this

Authentication required. http://localhost:8080 requires a username and password

and message prompts for a username and password.

I am building the project using mvn clean install and copy the war file to the tomcat/webapps.

And I start the tomcat using ./catalina.sh jpda run

What could have I done wrong? Please give some assistance.

Upvotes: 0

Views: 6246

Answers (3)

Rachel
Rachel

Reputation: 1

Check for

 <add type="HttpAuthModule.HttpAuthModule" name="HttpAuthModule" />

In your web config

Upvotes: 0

Kohei TAMURA
Kohei TAMURA

Reputation: 5122

If you got the message, Tomcat probably controls user access by web.xml that includes <security-constraint> and <login-config> elements or servlets that includes @SevletSecurity annotation defining how users are required to authenticate. So, you should check your application's web.xml and servlets and remove them if not needed.

Upvotes: 0

Rajat Verma
Rajat Verma

Reputation: 2590

Add this to your application.properties file

# turn off authentication
security.basic.enabled=false

Upvotes: 1

Related Questions