Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Unable to connect to MongoDB if password has special characters. #56

Closed
prashantkhandelwal opened this issue Jan 13, 2023 · 5 comments
Closed
Labels
⚙️ backend backend related issue 🐞 bug Something isn't working

Comments

@prashantkhandelwal
Copy link
Contributor

Unable to connect to MongoDB if there are special characters in the password.

For example: I was connecting to the database I have in Azure VM with a password which has '@' in it. The connection was failing as the special character has to be converted into Hexadecimal ASCII i.e. '@' will convert to '%40'. After this change, I was able to connect to the database.

I have made changes in this commit. @paraswaykole you can take a look and if all these changes seems okay, then I can raise a PR for this or if there is some other better way of doing this.

@paraswaykole
Copy link
Owner

Is it because of submitting HTML form doing that?

@prashantkhandelwal
Copy link
Contributor Author

I don't think it is due to HTML form. I have a password which has '@' in it and while debugging I am seeing it is passed as it is to the backed function. So UI is not making changes to the data being sent.

Therefore, I made change to the backend API code so that if someone plans to make use of the API, then this should no occur.

@paraswaykole paraswaykole added 🐞 bug Something isn't working ⚙️ backend backend related issue labels Jan 13, 2023
@paraswaykole
Copy link
Owner

Got it! Please send a PR.

@prashantkhandelwal
Copy link
Contributor Author

Got it! Please send a PR.

I will send a PR for this in a while as I want to check different combinations of password in MongoDB. '@' is a special case as MongoDB connection also has it and therefore it require escaping. Same can be said for colon (:) and few other characters.

Just want to be sure that fixing this should not lead to some other issue with passwords.

@prashantkhandelwal
Copy link
Contributor Author

PR raised - #60

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⚙️ backend backend related issue 🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants