-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 0.0.8, 0.0.7
-
Component/s: Authentication
-
None
in version 0.0.7 and 0.0.8 i get the following error when inserting into a collection:
"auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed."
i am running mongo in docker and have created a new database called "testdb" and added a user to it like so:
db.createUser({user: "sut", pwd: "Password1", roles: [ "readWrite" ]});
this code reproduces the error:
func main() { client, err := mongo.NewClient("mongodb://sut:Password1@127.0.0.1:27017/testdb") if err != nil { log.Fatal(err) } err = client.Connect(context.TODO()) if err != nil { log.Fatal(err) } collection := client.Database("testdb").Collection("qux") _, err = collection.InsertOne(context.Background(), map[string]string{"hello": "world"}) if err != nil { log.Fatal(err) } }
in 0.0.6 it works like a charm.
- is caused by
-
GODRIVER-486 Connection String AuthSource should default to using connection string database name before defaulting to admin
- Closed