Authorization Problems

So i setup my Mongodb with TLS auth and created all keys and certs. The user i log into Mongodb is already in the $external db.

 {
    _id: '$external.CN=admin',
    userId: new UUID("012da6f9-a284-4fbd-94f2-ddcdf23ba817"),
    user: 'CN=admin',
    db: '$external',
    roles: [ { role: 'userAdminAnyDatabase', db: 'admin' } ],
    mechanisms: [ 'external' ]
  }

In my Theory the user should have full rights now on the db but i face a auth error like below when i use for example show collections or insert a document into a db.

dev> show collections
MongoServerError: not authorized on dev to execute command { listCollections: 1, filter: {}, cursor: {}, nameOnly: true, authorizedCollections: false, lsid: { id: UUID("ea1db02d-2676-44ec-93e6-b1ae046c8942") }, $db: "dev", $readPreference: { mode: "primaryPreferred" } }

Has anyone an idea where the problem could be?

Thanks in advance
Jojo

Hi @Jo_M1,
I don’t understand why you created the 'user in the db $external.

Regards