[GODRIVER-485] Authentication degrade after 0.0.6 Created: 09/Jul/18  Updated: 28/Oct/23  Resolved: 12/Jul/18

Status: Closed
Project: Go Driver
Component/s: Authentication
Affects Version/s: 0.0.8, 0.0.7
Fix Version/s: 0.0.9

Type: Bug Priority: Major - P3
Reporter: lars helmer Assignee: Kristofer Brandow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by GODRIVER-486 Connection String AuthSource should d... Closed

 Description   

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.



 Comments   
Comment by lars helmer [ 09/Jul/18 ]

thank you for swift action!

Comment by Kristofer Brandow (Inactive) [ 09/Jul/18 ]

Hi larshelmer,

Thanks for the bug report. I've reproduced the issue and this is caused by an incorrect default setting, as described in GODRIVER-486. If you want to use Alpha 8, you can update the connection string to directly specify the auth mechanism: mongodb://sut:Password1@127.0.0.1:27017/testdb?authMechanism=SCRAM-SHA-1.

Thanks again for the report!
--Kris

Comment by lars helmer [ 09/Jul/18 ]

i am sorry about the code including characters that shouldn't be there. i didn't notice until after i had created the issue and i think it is something with Jira and braces.

Generated at Thu Feb 08 08:34:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.