Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-2

Provide examples of synchronous authentication

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 0.2
    • Affects Version/s: 0.1
    • Component/s: None
    • None

      Within my project, we tried to use `MotorDatabase.authenticate` when starting up our application, and it was tricky because it’s an async method, but the Tornado IOLoop hasn’t started yet, so we can’t use yield to make it block... and we actually do want it to block.

      We since discovered that we can work around this and obviate the need to use `authenticate` by passing a MongoDB URI to the MotorReplicaSetClient, and including the credentials in that URI.

      But since `authenticate` is in the docs, it isn’t unreasonable to think that others will see it and try to use it, and will encounter similar issues that my team did… the option of an `authenticate_sync` method would be handy and would be consistent with the existence of `MotorReplicaSetClient.open_sync`.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            aviflax Avi Flax
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: