Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1030

ClassCastException inside DBPort.SaslAuthenticator when custom BSON decoder is used

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 2.11.3
    • Authentication, BSON
    • None

    Description

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            emil.goicovici Emil Goicovici
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: