Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-25735

connectionStatus only returns info for most recently auth'd user

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.7
    • Component/s: None
    • None
    • ALL
    • Hide
      > 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
      }
      
      Show
      > 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 }

      From my understanding of how the connectionStatus command is supposed to work (based on the help text in the command, and discussion with kyle.suarez), it should return info on all auth'd users on the given connection. However, when I've attempted to make it do so, it seems to only return info for the user who most recently authenticated.

      I've plopped my shell copypasta into the Steps to Repro. I'm on 3.2.7.

            Assignee:
            Unassigned Unassigned
            Reporter:
            allison.moore@mongodb.com Allison Reinheimer Moore (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: