Currently the MongoProperties class does not take a username and password for the MongoDB database connection. You can work around this by specifying the authentication credentials in the URI: spring.data.mongodb.uri=mongodb://user:pass@host/database