title: Cannot access authenticated MongoDB collection from ReactiveMongo Play app
body: <p>I have a MongoDB server where I have enabled authentication and created users with DB-specific permissions.  The user for this app is defined as shown below i.e. geoAdmin has read, readWrite and dbOwner permissions for the relevant database:</p>
  
  <pre><code>MongoDB shell version: 3.0.0
  connecting to: 192.168.2.89/test
  &gt; use geo_db
  switched to db geo_db
  &gt; db.getUser("geoAdmin")
  {
      "_id" : "geo_db.geoAdmin",
      "user" : "geoAdmin",
      "db" : "geo_db",
      "roles" : [
          {
              "role" : "read",
              "db" : "geo_db"
          },
          {
              "role" : "dbOwner",
              "db" : "geo_db"
          },
          {
              "role" : "readWrite",
              "db" : "geo_db"
          }
      ]
  }
  </code></pre>
  
  <p>The following query works OK i.e. connecting to the remote server from my local mongo client:</p>
  
  <pre><code>mint:~ $ mongo 192.168.2.89:27017 -u geoAdmin -p secret --authenticationDatabase geo_db
  MongoDB shell version: 3.0.0
  connecting to: 192.168.2.89/test
  &gt; use geo_db
  switched to db geo_db
  &gt;  db.LAD_DEC_2013_GB_BFE.findOne({},{'properties.LAD13NM':1})
  {
      "_id" : ObjectId("54ffe2824f0787ec1293017f"),
      "properties" : {
          "LAD13NM" : "Hartlepool"
      }
  }
  </code></pre>
  
  <p>I then connect to the same remote host from a ReactiveMongo Play app on the same local client, with this URL in the app config file:</p>
  
  <pre><code># ReactiveMongo
  mongodb.uri = "mongodb://geoAdmin:secret@192.168.2.89:27017/geo_db"
  </code></pre>
  
  <p>But when my app tries to read from the same collection, I get a MongoDB "code = 13" error:</p>
  
  <pre><code>[DetailedDatabaseException: DatabaseException['not authorized for query on geo_db.LAD_DEC_2013_GB_BFE' (code = 13)]]
  </code></pre>
  
  <p>The app works fine if I connect to a local MongoDB which does not have authentication enabled.</p>
  
  <p>Any ideas what might be going wrong here?</p>