[CSHARP-986] Make Exception for '$' Character in '$external' Created: 05/Jun/14  Updated: 02/Apr/16  Resolved: 16/Jun/14

Status: Closed
Project: C# Driver
Component/s: Security
Affects Version/s: 1.9.1
Fix Version/s: 1.9.2

Type: Bug Priority: Major - P3
Reporter: Peter Garafano (Inactive) Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

The C# driver cannot be used to create externally authenticated users, such as Kerberos users because the driver restricts the use of '$' in database names. An exception is needed to allow references to '$external' within the driver.

When trying to get a reference to '$external' using the following code:

var client = new MongoClient();
var server = client.GetServer();
var db = server.GetDatabase("$external");

The following exception is thrown:

Database name '$external' is not valid. The character 0x0024 '$' is not allowed in database names.Parameter name: name

A possible patch would be inside MongoDB.Driver.MongoServer.IsDatabaseNameValid(string databaseName, out string message).



 Comments   
Comment by Githook User [ 16/Jun/14 ]

Author:

{u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-986: Allow $external as a database name even though it contains a "$".
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/f94a948f6823d42bf3ec9627c098e99fce27a47a

Comment by Githook User [ 16/Jun/14 ]

Author:

{u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-986: Allow $external as a database name even though it contains a "$".
Branch: v1.x
https://github.com/mongodb/mongo-csharp-driver/commit/88d1dfbb4701c762a2c7cd07d3fc384f62e24460

Generated at Wed Feb 07 21:38:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.