AuthenticationFailed to mongoDB with Spring boot
so maybe that's what I need from Spring
Of course, you are saying spring.data.mongodb.authentication-database = mydatabase
and it's incorrect!
You want to use spring.data.mongodb.authentication-database = admin
instead, and it will work.
If you are using spring.data.mongodb.uri
method,
spring.data.mongodb.uri=mongodb://stuart:stuartdto@localhost:27017/mydatabase?authSource=admin