Hi, I was trying to log in to the "Preferences" or "Tools" page in H2 console, but this operation requires H2 console password that cannot be set from Spring Boot, thus I am not able to log in to the H2 Console, providing an empty password string does not work.

Please read the whole scenario with solution bellow:

I have running Spring Boot application with embedded H2 database and H2 console.

When I want to go to the "Preferences" or "Tools" page in H2 console, I am asked for a password which is the webAdminPassword property of H2 console settings.

The problem is that application.properties does not support the webAdminPassword property, thus I am not able to log in to the "Preferences" or "Tools" page, providing an empty password string does not work.

I have added this property to the H2ConsoleAutoConfiguration class, the property can be configured in application.properties like this:

spring.h2.console.settings.web-admin-password=abcd

I have tested this implementation with my modified Spring Boot 2.2.6.RELEASE build and H2 h2-1.4.200. I was able to log in to the "Preferences" or "Tools" page with provided password in application.properties

This is a similar H2 configuration change to https://github.com/spring-projects/spring-boot/pull/5417

Comment From: pivotal-issuemaster

@RadekKoubsky Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-issuemaster

@RadekKoubsky Thank you for signing the Contributor License Agreement!

Comment From: snicoll

@RadekKoubsky thank you for making your first contribution to Spring Boot.

Comment From: RadekKoubsky

Thank you for accepting my pull request. I am always happy to contribute to the community.