[DOCS-10408] Auth for User DB not Working as in Documentation described Created: 19/Jun/17  Updated: 30/Oct/23  Resolved: 12/Apr/18

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: 3.4.5
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Björn Hase Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

PHP 7.0.6 - Ubuntu 16.04 LTS


Participants:
Days since reply: 5 years, 43 weeks, 6 days ago

 Description   

Hello,

when i'm following the description in the documentation on this site,
https://docs.mongodb.com/manual/tutorial/enable-authentication/

And Logged as "test"-User i get an "Unauthorized" on any command. But if i create the "test"-User directly in the "admin"-Database all works fine. The Question is, is there a Bug OR is the Documentation wrong? (or i don't understand it)

I have exatly followed the documentation, but the only way seems to create the User directly in the "admin"-Database



 Comments   
Comment by Kay Kim (Inactive) [ 12/Apr/18 ]

Hi – will close ticket as haven't heard back. Feel free to reopen.

Comment by Kay Kim (Inactive) [ 19/Jun/17 ]

Hi –
if you create the user in test database, when you connect, do you specify test as the authenticationDatabase or authSource for PHP?

For example:

$client = new MongoDB\Client('mongodb://myTester:xyz123@localhost:27017/test?authSource=test');

Generated at Thu Feb 08 08:00:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.