From deaa9051bc021116837282cbef64b318165423ca Mon Sep 17 00:00:00 2001 From: awgtek Date: Mon, 19 Oct 2015 13:26:02 -0400 Subject: [PATCH] Switch MongoCredential method Update MongoProperties to use `MongoCredential.createCredential` rather than `MongoCredential.createMongoCRCredential`. This allows connections to Mongo 3.0 servers to authenticate using the SCRAM-SHA-1 mechanism. Closes gh-4237 --- .../boot/autoconfigure/mongo/MongoProperties.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java index 80dd805b6ec..82303f721b3 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java @@ -217,8 +217,8 @@ public class MongoProperties { if (hasCustomCredentials()) { String database = this.authenticationDatabase == null ? getMongoClientDatabase() : this.authenticationDatabase; - credentials = Arrays.asList(MongoCredential.createMongoCRCredential( - this.username, database, this.password)); + credentials = Arrays.asList(MongoCredential + .createCredential(this.username, database, this.password)); } String host = this.host == null ? "localhost" : this.host; int port = determinePort(environment);