Mongodump is not working , getting "not authorized"

log in to the host machine and, in the terminal, simply run mongosh without parameters, then the following in it.

use admin
db.getUsers()

if you get an unauthorized error, that means you need to supply credentials. if you had no fight with that developer (and I believe not, as your database still works), just ask him/her about the administrator username/password.

PS: try mongo if mongosh is not found