| Steps To Reproduce: |
> db.createUser({user:"example",pwd:"abc123",roles:[{role:"readWrite",db:"example"}]})
|
Successfully added user: {
|
"user" : "example",
|
"roles" : [
|
{
|
"role" : "readWrite",
|
"db" : "example"
|
}
|
]
|
}
|
> db.createUser({user:"folklore",pwd:"abc123",roles:[{role:"readWrite",db:"folklore"}]})
|
Successfully added user: {
|
"user" : "folklore",
|
"roles" : [
|
{
|
"role" : "readWrite",
|
"db" : "folklore"
|
}
|
]
|
}
|
> db.auth("example","abc123")
|
1
|
> db.runCommand({connectionStatus:1})
|
{
|
"authInfo" : {
|
"authenticatedUsers" : [
|
{
|
"user" : "example",
|
"db" : "admin"
|
}
|
],
|
"authenticatedUserRoles" : [
|
{
|
"role" : "readWrite",
|
"db" : "example"
|
}
|
]
|
},
|
"ok" : 1
|
}
|
> db.auth("folklore","abc123")
|
1
|
> db.runCommand({connectionStatus:1})
|
{
|
"authInfo" : {
|
"authenticatedUsers" : [
|
{
|
"user" : "folklore",
|
"db" : "admin"
|
}
|
],
|
"authenticatedUserRoles" : [
|
{
|
"role" : "readWrite",
|
"db" : "folklore"
|
}
|
]
|
},
|
"ok" : 1
|
}
|
> db.auth('admin','admin')
|
1
|
> db.runCommand({connectionStatus:1})
|
{
|
"authInfo" : {
|
"authenticatedUsers" : [
|
{
|
"user" : "admin",
|
"db" : "admin"
|
}
|
],
|
"authenticatedUserRoles" : [
|
{
|
"role" : "root",
|
"db" : "admin"
|
}
|
]
|
},
|
"ok" : 1
|
}
|
|