Hello,
TLDR; Just got this all set up and working but had issues with the auth source in the generated MongoDB connection string.
I was having issues with the unify-network-application docker not authenticating with a new MongoDB install. Verified by looking at the contents of the logs in /usr/lib/unifi/logs but the logs didn't give the whole picture...
I added the users via mongosh on the docker (not init script)
Turns out the issue was caused by the authSource=admin param (default value) in the MongoDB connection string
Solution: removed authSource=admin from /usr/lib/unifi/data/system.properties so that it would fallback to the default auth source.
Thanks @ekim.w for calling out the location of the connection string.