Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-735

Authentication should fail gracefully with invalid auth mechanism

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.12, 2.0.0
    • Component/s: Authentication
    • Labels:
    • Story Points:
      1
    • Sprint:
      Ruby Sprint 9

      Description

      When connecting using a connection string, attempting to use a bogus auth mechanism results in a descriptive error message:

      > uri = "mongodb://user:pwd@host:port/example?authSource=$external&authMechanism=FAKE_METHOD"
      > new_client = MongoClient.from_uri(uri)
      Invalid value "fake_method" for authmechanism: must be one of GSSAPI, MONGODB-CR, MONGODB-X509, PLAIN

      However if we authenticate through code, we get a less descriptive error message:

      > client = MongoClient.new("host", port)
      > db = client.db("database")
      > db.authenticate(user, pwd, nil, "$external", FAKE_METHOD)
      undefined method `[]' for nil:NilClass

        Attachments

          Activity

            People

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            samantha.ritter Samantha Ritter
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: