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);