From 7be0b1c9f5af8aff58296a4c9e0cee414420b343 Mon Sep 17 00:00:00 2001 From: Dane Barentine Date: Mon, 7 Mar 2016 10:13:41 -0800 Subject: [PATCH] Use createCredential so that authentication will work with both 2.x and 3.x MongoDB servers --- .../mongo/DefaultMongoConnectionFactoryProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java b/model/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java index 74367c46d9..73f4128da2 100755 --- a/model/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java +++ b/model/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java @@ -239,7 +239,7 @@ public class DefaultMongoConnectionFactoryProvider implements MongoConnectionPro MongoClient client; 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); } else { client = new MongoClient(new ServerAddress(host, port), clientOptions);