To enforce authentication, the documentation states that the following entries should be made in the .env file: USERNAME=<your_username> and PASSWORD="<your_password>". This absolutely did not work for me. Only when I changed the entries to MONGOGUI_USERNAME="username"
MONGOGUI_PASSWORD="password" the authentication also worked.