Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5006

Link default auth source documentation to driver instead of incorrectly claiming "admin" is always the default

    • Fully Compatible

      From this page: https://docs.mongodb.com/mongoid/current/tutorials/mongoid-configuration/

      1. The database or source to authenticate the user against. (default: admin)
        auth_source: admin
        However, the default is not actually "admin". I had to add this line explicitly to my config in order to be able to connect, and I confirmed that removing it reintroduced the issue.

      With this line, I get the following error. You can see the auth source is set to the DB-level, not admin level.

      W, 2020-10-13T06:48:01.188705 #328 WARN – : MONGODB | Failed to authenticate to xxx-staging-shard-00-00.xxxxx.mongodb.net:27017: Mongo::Auth::Unauthorized: User xxx-staging-rw (mechanism: scram) is not authorized to access xxx_staging001 (auth source: xxx_staging001, used mechanism: SCRAM-SHA-1, used server: xxx-staging-shard-00-00.xxxxx.mongodb.net:27017 (PRIMARY)): Authentication failed. (18: AuthenticationFailed)

      Please check and either fix code or documentation.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            johnny.shields@gmail.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: