logging - MongoDB custom role -
i trying create user can create , read logs (not update , delete). however, after creating role , user, cannot authenticate. using mongodb 3.2.8.
use mylogdb db.createrole({ createrole: "readinsert", privileges: [ { resource: {db: "mylogdb", collection: ""}, actions: ["insert"] } ], roles: ["read"] }) db.createuser({ createuser: "6lbugxzezl14gzfk32a0n7x95sanhrrg0i3g", pwd: "qe+5837/]vux0k@b6nw;6(ucs", roles: [{role: "readinsert", db: "mylogdb"}] }) db.auth("6lbugxzezl14gzfk32a0n7x95sanhrrg0i3g", "qe+5837/]vux0k@b6nw;6(ucs")
i run above commands, responds with:
switched db mylogdb { "createrole" : "readinsert", "privileges" : [ { "resource" : { "db" : "mylogdb", "collection" : "" }, "actions" : [ "insert" ] } ], "roles" : [ "read" ] } added user: { "createuser" : "6lbugxzezl14gzfk32a0n7x95sanhrrg0i3g", "roles" : [ { "role" : "readinsert", "db" : "mylogdb" } ] } error: authentication failed. 0
i have bunch of other users in other databases have readwrite
permission, authenticates fine. (nb: auto generated user/password shares similar structure of ones used in production)
Comments
Post a Comment