Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
1.0.0
-
None
Description
Connecting using URI as below:
mongoURI := "mongodb://localhost:27017/test"
|
client, err := mongo.NewClient(options.Client().ApplyURI(mongoURI))
|
Generates application error:
2019/04/02 15:39:52 auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.
|
exit status 1
|
MongoDB (v4.0.8) server log error:
2019-04-02T15:39:52.728+1100 I NETWORK [conn105] received client metadata from 127.0.0.1:54219 conn105: { driver: { name: "mongo-go-driver", version: "v1.0.0" }, os: { type: "darwin", architecture: "amd64" }, platform: "go1.11.5" }
|
2019-04-02T15:39:52.728+1100 I ACCESS [conn105] Supported SASL mechanisms requested for unknown user '@test'
|
2019-04-02T15:39:52.728+1100 I ACCESS [conn105] SASL SCRAM-SHA-1 authentication failed for on test from client 127.0.0.1:54219 ; BadValue: Invalid SCRAM user name: n=
|
Changing the URI to any of the below works:
mongoURI := "mongodb://localhost:27017"
|
mongoURI := "mongodb://localhost:27017/admin"
|
mongoURI := "mongodb://localhost:27017/?authSource=admin"
|
Attachments
Issue Links
- is duplicated by
-
GODRIVER-921 with database specified in URI, driver should not neccessarily attempt to authenticate
-
- Closed
-
- related to
-
GODRIVER-1021 Specify behavior where connection string contain auth database but no credentials
-
- Closed
-