Support for webAdminPassword property of H2 Console #21533
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thewebAdminPassword
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 inapplication.properties
like this:I have tested this implementation with my modified Spring Boot
2.2.6.RELEASE
build and H2h2-1.4.200
. I was able to log in to the "Preferences" or "Tools" page with provided password inapplication.properties
This is a similar H2 configuration change to #5417