ClassCastException inside DBPort.SaslAuthenticator when custom BSON decoder is used

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.11.3
    • Component/s: Authentication, BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The implementation inside the DBPort.SaslAuthenticator.authenticate() method is making some class casting assuming that a given field (e.g. res.get("payload") ) is an instance of the expected class ( e.g. byte[] ). However, when custom BSON decoder is used for example returns org.bson.types.Binary instances instead of byte[] ones, these assumptions made inside the SaslAuthenticator.authenticate() are wrong and a ClassCastException will occur.

      Given these assumptions made inside the authenticate() method, it is necessary to change the sendSaslStart() call so that it uses the standard DefaultDBDecoder and not the user chosen one (which is set using a DBDecoderFactory).

            Assignee:
            Unassigned
            Reporter:
            Emil Goicovici
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: