[CSHARP-1060] Authentication is not done for DBCollection.createIndex() Created: 09/Sep/14 Updated: 04/Apr/15 Resolved: 04/Apr/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 1.9, 1.9.1, 1.9.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Vibhu Kasrija | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | driver | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 |
||
| Description |
|
I have enabled auth on MongoDB and created an admin user using:
When I am trying to connect my application to this database using this user and password, it is connecting fine but throwing an error when trying to create index on deadline7db_Jobs.Job collection. Below is the error:
I can create index from Mongo shell. |
| Comments |
| Comment by Craig Wilson [ 11/Sep/14 ] |
|
Hi Vibhu, sorry for the late response. I simply can't reproduce this. But I just had a thought you can try. Obviously, you are trying to do something on the "deadline7db_Jobs" database. However, it appears as though your user was created in the "admin" database. If this is true, then you need to use the "admin" database for your credentials, not the "deadline7db_Jobs" database. If that doesn't work, I'll need you to provide a list of reproducible steps and a Program.cs file I can use to run. |
| Comment by Vibhu Kasrija [ 11/Sep/14 ] |
|
Hi Craig, Could you please let me know if there is any update on this as this issue is a road blocker for me and need to get this resolved asap. Thanks! |
| Comment by Vibhu Kasrija [ 10/Sep/14 ] |
|
I can see similar issue here for java: https://jira.mongodb.org/browse/JAVA-1181 Vibhu |
| Comment by Vibhu Kasrija [ 10/Sep/14 ] |
|
Below is the code I am using to provide credentials to driver. MongoClientSettings mongoSettings = new MongoClientSettings(); MongoClient mongoClient = new MongoClient( mongoSettings );
C:\mongodir\application\bin\mongo.exe -u admin -p <password> --authenticationDatabase admin Thanks! |
| Comment by Craig Wilson [ 10/Sep/14 ] |
|
1. Are you providing the driver with the credentials? If so, how? Could you provide an example? 2. Are you providing the shell with credentials? If so, how? Could you provide an example? |
| Comment by Vibhu Kasrija [ 10/Sep/14 ] |
|
I am using C# driver (1.9.2). I guess root provides all the rights to create index if not then which privilege does it require? I am running everything on the same machine. Mongod, mongo and application all are on the same machine. If user doesn't have required rights then how is it working through mongo shell. Please let me know if you need further info. Vibhu |
| Comment by Craig Wilson [ 09/Sep/14 ] |
|
Hi Vibhu,
Thanks. |