You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing spring-boot-docker-compose (Spring Boot 3.1) I encountered an issue regarding MongoDB autoconfiguration. My Spring Boot application got an authentication error during start up. Spring Boot was using the initDB database as authentication target.
According to the official MongoDB image documentationMONGO_INITDB_ROOT_USERNAME and MONGO_INITDB_ROOT_PASSWORD are used to create a root user in admin database and not MONGO_INITDB_DATABASE. This would require to use admin as authentication database during autoconfiguration.
scottfrederick
changed the title
Autoconfiguration for spring-boot-docker-compose is missing the authSource option for the ConnectionString
Docker Compose connection details for MongoDB is missing the authSource option when authentication is configured
Jun 8, 2023
While testing
spring-boot-docker-compose
(Spring Boot 3.1) I encountered an issue regarding MongoDB autoconfiguration. My Spring Boot application got an authentication error during start up. Spring Boot was using the initDB database as authentication target.According to the official MongoDB image documentation
MONGO_INITDB_ROOT_USERNAME
andMONGO_INITDB_ROOT_PASSWORD
are used to create a root user inadmin
database and notMONGO_INITDB_DATABASE
. This would require to useadmin
as authentication database during autoconfiguration.The
StringBuilder
in class MongoDockerComposeConnectionDetailsFactory is missing the authSource option.[scottfrederick](#35567 (comment))
The text was updated successfully, but these errors were encountered: