Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URI login problem #42

Open
stephenkenny opened this issue Jul 21, 2023 · 4 comments
Open

URI login problem #42

stephenkenny opened this issue Jul 21, 2023 · 4 comments

Comments

@stephenkenny
Copy link

I'm able to connect successfully to a (Bitnami) MongoDB container by clicking on "I don't have an URI" and then entering the relevant details. Once logged in, I can see the database that I've set up in the MongoDB container listed under "Databases", towards the top left of the web page.

When I try the same credentials using the mongodb://user:pass...[etc] URI, I can also get logged in, but the difference is that I cannot see the database. On the page being displayed, there's nothing listed under "Databases".

Any help or advice much appreciated.

@SamuelTallet
Copy link
Owner

Have you tried specifying the database and the query param authSource in the MongoDB URI?

@stephenkenny
Copy link
Author

This is embarrassing - it actually works fine. I must've been doing something stupid on Friday. Thanks a lot for getting back to me. While I'm here - and at the risk of making another wrong conclusion about something :-) - can I ask if the following is the intended behaviour:

In the "I don't have an URI" method of logging in, if I supply an incorrect password, host or database name, I still get to see the landing page. It's only when I then click on the database name (on the landing page) that I get an error message detailing what's gone wrong. It's not a problem for us - we'll tell users to use the URI form of logging in. Was just curious.

Thanks a lot.

@stephenkenny
Copy link
Author

stephenkenny commented Jul 25, 2023

Hi again - I don't know if I was seeing things earlier, but after a simplified rebuild of my containers setup - with just a MongoDB UI container talking to a Bitnami MongoDB container configured with an initialized database (no Apache or Nginx reverse proxy in the mix) - I am back in the situation where the URI-based login doesn't show me the database on the landing page, whereas the non-URI login method does. I used Firefox's web developer tools to examine the POST request. They differ as follows

await fetch("http://127.0.0.1:5000/login", {
"credentials": "include",
"headers": {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Content-Type": "application/x-www-form-urlencoded",
"Upgrade-Insecure-Requests": "1",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-User": "?1"
},
"referrer": "http://127.0.0.1:5000/login",
"body": "uri=mongodb%3A%2F%2Fcarbonquest%3ALogVincentQuad%40mongodb_carbonquest%3A27017%2Fcarbonquest_db",
"method": "POST",
"mode": "cors"
});

@stephenkenny
Copy link
Author

Sorry, I'm inexperienced with posting on Github - the above message was incomplete. To finish, the "body" lines for the URI- and non-URI-based login methods are, respectively as follows:

"body": "uri=mongodb%3A%2F%2Fcarbonquest%3ALogVincentQuad%40mongodb_carbonquest%3A27017%2Fcarbonquest_db",

"body": "user=carbonquest&password=LogVincentQuad&host=mongodb_carbonquest&port=27017&database=carbonquest_db",

I dunno if that is indicative of me doing something wrong ....

Thanks once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants