Make authentication compatible with MongoDB 3.0

Description

MongoDB 3 brings a new authentication support SCRAM-SHA-1 and deprecated MONGODB-CR.

The support came with Java's driver 2.13 but requires some migrations https://github.com/mongodb/mongo-java-driver/releases/tag/r2.13.0

  • Upgrade to Java's driver 2.13

  • replace the default MongoDBProperties.AUTHENTICATION_MECHANISM from MONGODB-CR to SCRAM-SHA-1 (and add the latter in AuthenticationMechanismType)

  • write in the migration guide how to explicitly set the auth mechanism for people with older MongoDB databases

  • Change to use MongoCredential.html#createCredential instead of MongoCredential#createMongoCRCredential

That should do the trick.

The workaround according to Dean is to do

Environment

None

Assignee

Unassigned

Reporter

Emmanuel Bernard

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Blocker
Configure