Trochę kopania i odkryłem, że Mongo 3 nie lubi wyzwań-odpowiedzi i woli „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);