Fail to Connect from Studio3T

Hi,

I’m trying to connect M121 course database using Studio3T but failing in authentication.
This is my connection info and error message.



Database error (MongoSecurityException): Exception authenticating MongoCredential{mechanism=SCRAM-SHA-256, userName='m121', source='admin', password=<hidden>, mechanismProperties=<hidden>}

Stacktrace:
|_/ Database error (MongoSecurityException): Exception authenticating MongoCredential{mechanism=SCRAM-SHA-256, userName='m121', source='admin', password=<hidden>, mechanismProperties=<hidden>}
|____/ Mongo Server error (MongoCommandException): Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server cluster0-shard-00-01-jxeqq.mongodb.net:27017. 
|____... 
|____... The full response is:
|____... { 
|____...     "operationTime" : Timestamp(1623478817, 1), 
|____...     "ok" : 0.0, 
|____...     "errmsg" : "Authentication failed.", 
|____...     "code" : 18.0, 
|____...     "codeName" : "AuthenticationFailed", 
|____...     "$clusterTime" : {
|____...         "clusterTime" : Timestamp(1623478817, 1), 
|____...         "signature" : {
|____...             "hash" : {
|____...                 "$binary" : {
|____...                     "base64" : "3Nn3EtlCmraOGGTNaJycy2lLGl0=", 
|____...                     "subType" : "00"
|____...                 }
|____...             }, 
|____...             "keyId" : 6931036270290272300.0
|____...         }
|____...     }
|____... }

Hi @Jinhong_Kim, the error states that the authentication got failed, which means you might have entered a wrong set of credentials(username & password)., can you please verify your credentials?

Go to your cluster management dashboard on Atlas → Click on Database Access → Click on edit to see your credentials for the particular user, as shown in the images below.


I hope it helps.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

Hi @SourabhBagrecha ,

Thank you for your reply!
I’m using the credentials from the M121 course → Chapter 0 → Lecture: Atlas Requirement

mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl -u m121 -p aggregations --norc

I can access the database with the above command in Terminal but I failed from Studio3T.
It turns out the issue was the authentication mode.
After I changed the authentication mode from “Basic (SCRAM-SHA-256)” to “Legacy (SCRAM-SHA-1)”, I could access using Studio3T.

Thanks,
Jinhong

2 Likes