I came across this error today whilst trying to deploy my application on Azure.
MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> MongoDB.Driver.MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.
As it turns out, MongoDB may have separate databases for authentication and data and therefore it is essential to specify which database to authenticate against. My initial settings were:
1 |
mongodb://username:password@host.mlab.com:port/ |
1 |
mongodb://username:password@host.mlab.com:port/YOURDB |
One thought on “How to resolve: MongoDB.Driver.MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.”