Let's say my password is 2yPK}Bzj|qE($^1JDdk4J42*&4lLgV%C. Then the percent encoded version of this password is 2yPK%7DBzj%7CqE%28%24%5E1JDdk4J42%2A%264lLgV%25C and hence the url connection string would be:
mongodb://myusername:2yPK%7DBzj%7CqE%28%24%5E1JDdk4J42%2A%264lLgV%25C@mymongodbserver:27017/admin
However, this doesn't work when using the driver. If I don't percent encode the password, and pass it directly instead: mongodb://myusername:2yPK}Bzj|qE($^1JDdk4J42*&4lLgV%C@mymongodbserver:27017/admin
It works (when it shouldn't).
Found with v0.5.1.
Let's say my password is
2yPK}Bzj|qE($^1JDdk4J42*&4lLgV%C
. Then the percent encoded version of this password is2yPK%7DBzj%7CqE%28%24%5E1JDdk4J42%2A%264lLgV%25C
and hence theurl
connection string would be:mongodb://myusername:2yPK%7DBzj%7CqE%28%24%5E1JDdk4J42%2A%264lLgV%25C@mymongodbserver:27017/admin
However, this doesn't work when using the driver. If I don't percent encode the password, and pass it directly instead:
mongodb://myusername:2yPK}Bzj|qE($^1JDdk4J42*&4lLgV%C@mymongodbserver:27017/admin
It works (when it shouldn't).The documentation states that usernames and passwords are to be percent encoded: https://docs.mongodb.com/manual/reference/connection-string/#components "If the username or password includes the at sign @, colon :, slash /, or the percent sign % character, use percent encoding."
I have used the percent encoded password on other MongoDB drivers, such as the C# and Python drivers and they work correctly.