Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-986

Make Exception for '$' Character in '$external'

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.2
    • Affects Version/s: 1.9.1
    • Component/s: Security
    • None

      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).

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            peter.garafano@mongodb.com Peter Garafano (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: