Малко ровене и открих, че Mongo 3 не обича предизвикателство-отговор и предпочита „MongoCredential.createScramSha1Credential '
List<ServerAddress> seeds = new ArrayList<ServerAddress>();
seeds.add( new ServerAddress( "remoteServer" ));
List<MongoCredential> credentials = new ArrayList<MongoCredential>();
credentials.add(
MongoCredential.createScramSha1Credential(
"username",
"adminDatabase",
"password".toCharArray()
)
);
MongoClient mongoClient = new MongoClient( seeds, credentials );
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(mongoClient, "applicationDatabase");
mongoTemplate = new MongoTemplate(mongoDbFactory);