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

Can't connect to auth-enabled server #73

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

Comments

Projects
None yet
2 participants
@dantetwc

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

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Jan 18, 2013

Owner

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

Owner

bobthecow commented Jan 18, 2013

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

@dantetwc

This comment has been minimized.

Show comment
Hide comment
@dantetwc

dantetwc Jan 18, 2013

I am using rubygem version 2.1.6

I am using rubygem version 2.1.6

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Jan 18, 2013

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.

Owner

bobthecow commented Jan 18, 2013

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

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Jan 18, 2013

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.

Owner

bobthecow commented Jan 18, 2013

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

This comment has been minimized.

Show comment
Hide comment
@dantetwc

dantetwc Jan 18, 2013

Thanks

login:password@mongodb.example.com/admin

it works now

Thanks

login:password@mongodb.example.com/admin

it works now

@dantetwc dantetwc closed this Jan 18, 2013

bobthecow added a commit that referenced this issue Jan 18, 2013

[rb] Auth against `admin` db if none is specified.
Additionally, improve authentication failure error messaging.

Fixes #73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment