Gustavo Gustavo - 1 month ago 19
Java Question

What is username and password for Spring Boot starter Tomcat?

When I deploy my Spring application via Spring Boot and access

I have to authenticate, but what is the username and password or how can I set it?
I tried to add this to my
file but it didn't work :

<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-gui"/>

This is the starting point of the application:

public class Application extends SpringBootServletInitializer {

public static void main(String[] args) {, args);

protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);

And this is the Tomcat dependency:


How to authenticate on


I think that you have Spring Security on your class path and then spring security is automatically configured with a default user and generated password

Please look into your pom.xml file for:


If you have that in your pom than you should have a log console message like this:

Using default security password: ce6c3d39-8f20-4a41-8e01-803166bb99b6

And in the browser prompt you will import the user user and the password printed in the console.

Or if you want to configure spring security you can take a look at Spring Boot secured example

It is explained in the Spring Boot Reference documentation in the Security section, it indicates:

The default AuthenticationManager has a single user (‘user’ username and random password, printed at `INFO` level when the application starts up)

Using default security password: 78fa095d-3f4c-48b1-ad50-e24c31d5cf35