I’m getting the below error when trying to create a MongoClient using the connection string got from Azure MongoDB CosmosDB.
com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=SCRAM-SHA-1, userName='test-cosmos-account', source='admin', password=<hidden>, mechanismProperties=<hidden>}
Caused by: com.mongodb.MongoCommandException: Command failed with error 18 (AuthenticationFailed): 'Invalid key' on server test-cosmos-account-westus.mongo.cosmos.azure.com:10255. The full response is {"ok": 0.0, "errmsg": "Invalid key", "code": 18, "codeName": "AuthenticationFailed"}
I’m using the Java driver - org.mongodb.mongodb-driver-sync Version: 4.8.2
Can anyone help me on this?