Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Can't connect to auth-enabled server #73

Closed
dantetwc opened this issue Jan 18, 2013 · 5 comments
Closed

Can't connect to auth-enabled server #73

dantetwc opened this issue Jan 18, 2013 · 5 comments
Labels

Comments

@dantetwc
Copy link

Hi,
I tried to connect my MongoDB which is auth-enabled

login:password@mongodb.example.com

It keeps saying malformed URI, how can I solve it?

@bobthecow
Copy link
Owner

That should work. What Genghis version are you running? And which backend?

@dantetwc
Copy link
Author

I am using rubygem version 2.1.6

@bobthecow
Copy link
Owner

Oh, I got it. You need to authenticate against a DB. If your user has global privileges, just authenticate against admin:

login:password@mongodb.example.com/admin

I'll make this a better experience in v2.2.0.

@bobthecow
Copy link
Owner

Note that this is only a problem with the Ruby backend. Apparently the PHP MongoDB driver implicitly authenticates against admin if no database is specified, but the Ruby driver throws an exception. I'll make the Ruby backend act like the PHP driver.

@dantetwc
Copy link
Author

Thanks

login:password@mongodb.example.com/admin

it works now

bobthecow added a commit that referenced this issue Jan 18, 2013
Additionally, improve authentication failure error messaging.

Fixes #73
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants