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

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
bug

Comments

@dantetwc
Copy link

@dantetwc dantetwc commented Jan 18, 2013

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

@bobthecow bobthecow commented Jan 18, 2013

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

@dantetwc
Copy link
Author

@dantetwc dantetwc commented Jan 18, 2013

I am using rubygem version 2.1.6

@bobthecow
Copy link
Owner

@bobthecow 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
Copy link
Owner

@bobthecow 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
Copy link
Author

@dantetwc dantetwc commented Jan 18, 2013

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
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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.