Unable to connect to mongodb using dremio

I have a mongodb version 5.0.3 , community edition installed on linux server.
on the same server dremio is also installed. i am able to connect to localhost “127.0.0.1”
as below: mongo --port 27017 --authenticationDatabase “admin” -u “username” . It asks for pwd and after pwd given it connects, I tried the same on dremio, hostname i tried with “localhost”, “127.0.0.1” but it always throws error couldnt authenticate/access database “admin”.

Can someone tell me if any aditional settings need to be made?
also the mongodb server is not sharded or replica set. Its a standalone cluster , community version installed for testing purpose. Not much data exists in it. and it has only single user.

@harshitha3079 Welcome to Dremio Community!

Seems to work fine for me on localhost on v5.0.3 Community Edition (no additional settings):

How did you create the mongo user? I created user rgMongoAdmin as below and it works:

db.createUser(
{ user: "rgMongoAdmin",
pwd: "password",
roles: [ "readWrite", "dbAdmin" ]
}
)

@harshitha3079 This is because you have to whitelist the Dremio host on the Mongo side. This is an error coming from MongoDB, I am not sure if that is needed when connecting natively