Mongodb error in v5.0.18 Authentication failed

Hi I m trying to connect to MongoDB v 5.0.18 in the password when I use percentage encoding it is giving me an error as

{"log": "time=\"Jul 13 18:10:09\" level=fatal msg=\"Could not start storage\" error=\"connection() error occurred during connection handshake: auth error: unable to authenticate using mechanism \\\"SCRAM-SHA-256\\\": (AuthenticationFailed) Authentication failed.\"\n","stream":"stderr","time":"2023-07-13T08:10:09.472843706Z"}

but when I do not use percentage encoding it is working perfectly
I m using the dashboard version 5.0.2 please help it is a bit urgent

using mongo_url 
    "mongo_url": "mongodb://DbOwner:E%5B%3Cj%5E%23@svssp2001001ps.nbndc.local:27017,svssp2001002ps.nbndc.local:27017,svssp2001003ps.nbndc.local:27017/tyk_analytics?replicaSet=mongo-replica",
    "mongo_driver": "mongo-go",

Hi @Anshul_Chopra,

Welcome to the MongoDB Community!

Based on the shared details, it appears that your password contains a special character that requires URL encoding.

So, you have another option. You can use a code snippet in Golang to perform the encoding within your code.

Sharing example code snippet for reference:

import "net/url"
password, err := url.QueryUnescape("p@sword%20")
 if err != nil {
  password = "p@sword%20"

Hope it helps!