SCRAM-SHA-1: (AtlasError) bad auth : Authentication failed while using mongodb api

Hey @everyone
I am trying to make crud api request using mongodb Data API. I am trying to make requests to my database to get data from the collections. I have whitelisted my IP and have added IP for connecting from anywhere. I have also added the API key to the request and in the body i am passing the
{ "dataSource": "Cluster0", "database" : "myFirstDatabase", "collection" : "phonelogsdetails" }
Any idea on why this autnentication error is coming and how to remove it

It says bad authentication
Are you using correct userid/pwd?
Can you connect by shell?
Does your password has any special characters?

1 Like
  1. Disconnect your wifi connection and connect it to another wifi. (optional step, but recommended)
  2. Go to MongoDB Atlas → database access → database users (find your username in the list) → edit → edit password (add your MongoDB Atlas password) → click update user
  3. Hit the like icon to tell whether it worked or not.