401 - Unauthorized when connecting to mongodb custom databas

Hi, I’m following this guide Connecting Auth0 to MongoDB with Custom Databases
trying to connect auth0 to my mongodb, but I get 401 - Unauthorized when trying the “login” functionality.

I’ve tried running nodejs 16 with mongodb 4.1.0 as per previously suggested.

My connection to mongodb works locally.

This is the connectionstring im using to try to connect: mongodb+srv://user:password@cluster.xxxxxx.mongodb.net/?retryWrites=true&w=majority&appName=Cluster

using like this in the mongodb template:

const client = new MongoClient(configuration.URI);

What can be the issue?