Merge pull request #2340 from dbarentine/master

KEYCLOAK-2609 Use createCredential so that authentication will work with both 2.x a…
This commit is contained in:
Stian Thorgersen 2016-03-08 07:54:46 +01:00
commit 446c9fea4b

View file

@ -239,7 +239,7 @@ public class DefaultMongoConnectionFactoryProvider implements MongoConnectionPro
MongoClient client; MongoClient client;
if (user != null && password != null) { if (user != null && password != null) {
MongoCredential credential = MongoCredential.createMongoCRCredential(user, dbName, password.toCharArray()); MongoCredential credential = MongoCredential.createCredential(user, dbName, password.toCharArray());
client = new MongoClient(new ServerAddress(host, port), Collections.singletonList(credential), clientOptions); client = new MongoClient(new ServerAddress(host, port), Collections.singletonList(credential), clientOptions);
} else { } else {
client = new MongoClient(new ServerAddress(host, port), clientOptions); client = new MongoClient(new ServerAddress(host, port), clientOptions);