Update the bind operation so that it provides access to the protocol version.
Note that the protocol version is formatted as a string, because it may not
necessarily always be purely numeric.
OpenDS Issue Number: 1037
| | |
| | | implements PreParseBindOperation, PreOperationBindOperation, |
| | | PostOperationBindOperation, PostResponseBindOperation |
| | | { |
| | | |
| | | |
| | | |
| | | // The credentials used for SASL authentication. |
| | | private ASN1OctetString saslCredentials; |
| | | |
| | |
| | | // A message explaining the reason for the authentication failure. |
| | | private String authFailureReason; |
| | | |
| | | // A string representation of the protocol version for this bind operation. |
| | | private String protocolVersion; |
| | | |
| | | // The SASL mechanism used for SASL authentication. |
| | | private String saslMechanism; |
| | | |
| | |
| | | * @param messageID The message ID of the request with which this |
| | | * operation is associated. |
| | | * @param requestControls The set of controls included in the request. |
| | | * @param protocolVersion The string representation of the protocol version |
| | | * associated with this bind request. |
| | | * @param rawBindDN The raw, unprocessed bind DN as provided in the |
| | | * request from the client. |
| | | * @param simplePassword The password to use for the simple |
| | |
| | | */ |
| | | public BindOperation(ClientConnection clientConnection, long operationID, |
| | | int messageID, List<Control> requestControls, |
| | | ByteString rawBindDN, ByteString simplePassword) |
| | | String protocolVersion, ByteString rawBindDN, |
| | | ByteString simplePassword) |
| | | { |
| | | super(clientConnection, operationID, messageID, requestControls); |
| | | |
| | | |
| | | this.protocolVersion = protocolVersion; |
| | | this.authType = AuthenticationType.SIMPLE; |
| | | this.saslMechanism = null; |
| | | this.saslCredentials = null; |
| | |
| | | * @param messageID The message ID of the request with which this |
| | | * operation is associated. |
| | | * @param requestControls The set of controls included in the request. |
| | | * @param protocolVersion The string representation of the protocol version |
| | | * associated with this bind request. |
| | | * @param rawBindDN The raw, unprocessed bind DN as provided in the |
| | | * request from the client. |
| | | * @param saslMechanism The SASL mechanism included in the request. |
| | |
| | | */ |
| | | public BindOperation(ClientConnection clientConnection, long operationID, |
| | | int messageID, List<Control> requestControls, |
| | | ByteString rawBindDN, String saslMechanism, |
| | | ASN1OctetString saslCredentials) |
| | | String protocolVersion, ByteString rawBindDN, |
| | | String saslMechanism, ASN1OctetString saslCredentials) |
| | | { |
| | | super(clientConnection, operationID, messageID, requestControls); |
| | | |
| | | |
| | | this.protocolVersion = protocolVersion; |
| | | this.authType = AuthenticationType.SASL; |
| | | this.saslMechanism = saslMechanism; |
| | | this.saslCredentials = saslCredentials; |
| | |
| | | * @param messageID The message ID of the request with which this |
| | | * operation is associated. |
| | | * @param requestControls The set of controls included in the request. |
| | | * @param protocolVersion The string representation of the protocol version |
| | | * associated with this bind request. |
| | | * @param bindDN The bind DN for this bind operation. |
| | | * @param simplePassword The password to use for the simple |
| | | * authentication. |
| | | */ |
| | | public BindOperation(ClientConnection clientConnection, long operationID, |
| | | int messageID, List<Control> requestControls, DN bindDN, |
| | | int messageID, List<Control> requestControls, |
| | | String protocolVersion, DN bindDN, |
| | | ByteString simplePassword) |
| | | { |
| | | super(clientConnection, operationID, messageID, requestControls); |
| | | |
| | | |
| | | this.protocolVersion = protocolVersion; |
| | | this.authType = AuthenticationType.SIMPLE; |
| | | this.bindDN = bindDN; |
| | | this.saslMechanism = null; |
| | |
| | | * @param messageID The message ID of the request with which this |
| | | * operation is associated. |
| | | * @param requestControls The set of controls included in the request. |
| | | * @param protocolVersion The string representation of the protocol version |
| | | * associated with this bind request. |
| | | * @param bindDN The bind DN for this bind operation. |
| | | * @param saslMechanism The SASL mechanism included in the request. |
| | | * @param saslCredentials The optional SASL credentials included in the |
| | | * request. |
| | | */ |
| | | public BindOperation(ClientConnection clientConnection, long operationID, |
| | | int messageID, List<Control> requestControls, DN bindDN, |
| | | int messageID, List<Control> requestControls, |
| | | String protocolVersion, DN bindDN, |
| | | String saslMechanism, ASN1OctetString saslCredentials) |
| | | { |
| | | super(clientConnection, operationID, messageID, requestControls); |
| | | |
| | | |
| | | this.protocolVersion = protocolVersion; |
| | | this.authType = AuthenticationType.SASL; |
| | | this.bindDN = bindDN; |
| | | this.saslMechanism = saslMechanism; |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a string representation of the protocol version associated with |
| | | * this bind request. |
| | | * |
| | | * @return A string representation of the protocol version associated with |
| | | * this bind request. |
| | | */ |
| | | public String getProtocolVersion() |
| | | { |
| | | return protocolVersion; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Specifies the string representation of the protocol version associated with |
| | | * this bind request. |
| | | * |
| | | * @param protocolVersion The string representation of the protocol version |
| | | * associated with this bind request. |
| | | */ |
| | | public void setProtocolVersion(String protocolVersion) |
| | | { |
| | | this.protocolVersion = protocolVersion; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the bind DN for this bind operation. This method should not be |
| | | * called by pre-parse plugins, as the raw value will not have been processed |
| | | * by that time. Instead, pre-parse plugins should call the |
| | |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | | buffer.append(operationID); |
| | | buffer.append(", dn="); |
| | | buffer.append(", protocol=\""); |
| | | buffer.append(clientConnection.getProtocol()); |
| | | buffer.append(" "); |
| | | buffer.append(protocolVersion); |
| | | buffer.append("\", dn="); |
| | | buffer.append(rawBindDN); |
| | | buffer.append(", authType="); |
| | | buffer.append(authType); |
| | |
| | | public class InternalClientConnection |
| | | extends ClientConnection |
| | | { |
| | | /** |
| | | * The protocol verison string that will be used for internal bind |
| | | * operations. Since this is modeled after LDAPv3 binds, it will |
| | | * use a version number string of "3". |
| | | */ |
| | | public static final String PROTOCOL_VERSION = "3"; |
| | | |
| | | |
| | | |
| | | // The message ID counter to use for internal connections. |
| | | private static AtomicInteger nextMessageID; |
| | | |
| | |
| | | { |
| | | BindOperation bindOperation = |
| | | new BindOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), rawBindDN, |
| | | password); |
| | | new ArrayList<Control>(0), |
| | | PROTOCOL_VERSION, rawBindDN, password); |
| | | bindOperation.setInternalOperation(true); |
| | | |
| | | bindOperation.run(); |
| | |
| | | { |
| | | BindOperation bindOperation = |
| | | new BindOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), bindDN, |
| | | password); |
| | | new ArrayList<Control>(0), |
| | | PROTOCOL_VERSION, bindDN, password); |
| | | bindOperation.setInternalOperation(true); |
| | | |
| | | bindOperation.run(); |
| | |
| | | { |
| | | BindOperation bindOperation = |
| | | new BindOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), rawBindDN, |
| | | saslMechanism, saslCredentials); |
| | | new ArrayList<Control>(0), |
| | | PROTOCOL_VERSION, rawBindDN, saslMechanism, |
| | | saslCredentials); |
| | | bindOperation.setInternalOperation(true); |
| | | |
| | | bindOperation.run(); |
| | |
| | | { |
| | | BindOperation bindOperation = |
| | | new BindOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), bindDN, |
| | | saslMechanism, saslCredentials); |
| | | new ArrayList<Control>(0), |
| | | PROTOCOL_VERSION, bindDN, saslMechanism, |
| | | saslCredentials); |
| | | bindOperation.setInternalOperation(true); |
| | | |
| | | bindOperation.run(); |
| | |
| | | jmxConnectionHandler, authInfo); |
| | | |
| | | BindOperation bindOp = new BindOperation(jmxClientConnection, |
| | | jmxClientConnection.nextOperationID(), jmxClientConnection |
| | | .nextMessageID(), requestControls, new ASN1OctetString(authcID), |
| | | bindPW); |
| | | jmxClientConnection.nextOperationID(), |
| | | jmxClientConnection.nextMessageID(), requestControls, |
| | | jmxConnectionHandler.getRMIConnector().getProtocolVersion(), |
| | | new ASN1OctetString(authcID), bindPW); |
| | | |
| | | bindOp.run(); |
| | | if (bindOp.getResultCode() == ResultCode.SUCCESS) |
| | |
| | | /** |
| | | * The Underlying Socket factory. |
| | | */ |
| | | OpendsRmiServerSocketFactory rmiSsf; |
| | | private OpendsRmiServerSocketFactory rmiSsf; |
| | | |
| | | /** |
| | | * The RMI protocol verison used by this connector. |
| | | */ |
| | | private String rmiVersion; |
| | | |
| | | // =================================================================== |
| | | // CONSTRUCTOR |
| | |
| | | // TODO Should we do that? |
| | | ObjectName name = new ObjectName(jmxRmiConnectorNoClientCertificateName); |
| | | mbs.registerMBean(jmxRmiConnectorNoClientCertificate, name); |
| | | rmiVersion = opendsRmiConnectorServer.getVersion(); |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the RMI protocol version string in use for this connector. |
| | | * |
| | | * @return The RMI protocol version string in use for this connector. |
| | | */ |
| | | public String getProtocolVersion() |
| | | { |
| | | return rmiVersion; |
| | | } |
| | | } |
| | |
| | | |
| | | // See if this is an LDAPv2 bind request, and if so whether that should be |
| | | // allowed. |
| | | ldapVersion = protocolOp.getProtocolVersion(); |
| | | if ((ldapVersion == 2) && (! connectionHandler.allowLDAPv2())) |
| | | String versionString; |
| | | switch (ldapVersion = protocolOp.getProtocolVersion()) |
| | | { |
| | | BindResponseProtocolOp responseOp = |
| | | new BindResponseProtocolOp( |
| | | LDAPResultCode.INAPPROPRIATE_AUTHENTICATION, |
| | | getMessage(MSGID_LDAPV2_CLIENTS_NOT_ALLOWED)); |
| | | sendLDAPMessage(securityProvider, |
| | | new LDAPMessage(message.getMessageID(), responseOp)); |
| | | disconnect(DisconnectReason.PROTOCOL_ERROR, false, null, -1); |
| | | return false; |
| | | case 2: |
| | | versionString = "2"; |
| | | |
| | | if (! connectionHandler.allowLDAPv2()) |
| | | { |
| | | BindResponseProtocolOp responseOp = |
| | | new BindResponseProtocolOp( |
| | | LDAPResultCode.INAPPROPRIATE_AUTHENTICATION, |
| | | getMessage(MSGID_LDAPV2_CLIENTS_NOT_ALLOWED)); |
| | | sendLDAPMessage(securityProvider, |
| | | new LDAPMessage(message.getMessageID(), responseOp)); |
| | | disconnect(DisconnectReason.PROTOCOL_ERROR, false, null, -1); |
| | | return false; |
| | | } |
| | | |
| | | break; |
| | | case 3: |
| | | versionString = "3"; |
| | | break; |
| | | default: |
| | | versionString = String.valueOf(ldapVersion); |
| | | break; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | case SIMPLE: |
| | | bindOp = new BindOperation(this, nextOperationID.getAndIncrement(), |
| | | message.getMessageID(), controls, bindDN, |
| | | message.getMessageID(), controls, |
| | | versionString, bindDN, |
| | | protocolOp.getSimplePassword()); |
| | | break; |
| | | case SASL: |
| | | bindOp = new BindOperation(this, nextOperationID.getAndIncrement(), |
| | | message.getMessageID(), controls, bindDN, |
| | | message.getMessageID(), controls, |
| | | versionString, bindDN, |
| | | protocolOp.getSASLMechanism(), |
| | | protocolOp.getSASLCredentials()); |
| | | break; |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a string representation of the protocol version |
| | | * associated with this bind request. |
| | | * |
| | | * @return A string representation of the protocol version |
| | | * associated with this bind request. |
| | | */ |
| | | public String getProtocolVersion(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the raw, unprocessed bind DN for this bind operation as |
| | | * contained in the client request. The value may not actually |
| | | * contain a valid DN, as no validation will have been performed. |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a string representation of the protocol version |
| | | * associated with this bind request. |
| | | * |
| | | * @return A string representation of the protocol version |
| | | * associated with this bind request. |
| | | */ |
| | | public String getProtocolVersion(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the raw, unprocessed bind DN for this bind operation as |
| | | * contained in the client request. The value may not actually |
| | | * contain a valid DN, as no validation will have been performed. |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a string representation of the protocol version |
| | | * associated with this bind request. |
| | | * |
| | | * @return A string representation of the protocol version |
| | | * associated with this bind request. |
| | | */ |
| | | public String getProtocolVersion(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the raw, unprocessed bind DN for this bind operation as |
| | | * contained in the client request. The value may not actually |
| | | * contain a valid DN, as no validation will have been performed. |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a string representation of the protocol version |
| | | * associated with this bind request. |
| | | * |
| | | * @return A string representation of the protocol version |
| | | * associated with this bind request. |
| | | */ |
| | | public String getProtocolVersion(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Specifies the string representation of the protocol version |
| | | * associated with this bind request. |
| | | * |
| | | * @param protocolVersion The string representation of the |
| | | * protocol version associated with this |
| | | * bind request. |
| | | */ |
| | | public void setProtocolVersion(String protocolVersion); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the raw, unprocessed bind DN for this bind operation as |
| | | * contained in the client request. The value may not actually |
| | | * contain a valid DN, as no validation will have been performed. |
| | |
| | | BindOperation[] simpleBinds = new BindOperation[] |
| | | { |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, new ASN1OctetString(), new ASN1OctetString()), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, new ASN1OctetString(), |
| | | null, "3", new ASN1OctetString(), |
| | | new ASN1OctetString()), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, nullOS, new ASN1OctetString()), |
| | | noControls, "3", new ASN1OctetString(), |
| | | new ASN1OctetString()), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, nullOS, new ASN1OctetString()), |
| | | null, "3", nullOS, new ASN1OctetString()), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, new ASN1OctetString(), nullOS), |
| | | noControls, "3", nullOS, new ASN1OctetString()), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, new ASN1OctetString(), nullOS), |
| | | null, "3", new ASN1OctetString(), nullOS), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, nullOS, nullOS), |
| | | noControls, "3", new ASN1OctetString(), nullOS), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, nullOS, nullOS), |
| | | null, "3", nullOS, nullOS), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, new ASN1OctetString("cn=Directory Manager"), |
| | | noControls, "3", nullOS, nullOS), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, "3", |
| | | new ASN1OctetString("cn=Directory Manager"), |
| | | new ASN1OctetString("password")), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, DN.nullDN(), new ASN1OctetString()), |
| | | null, "3", DN.nullDN(), new ASN1OctetString()), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, DN.nullDN(), new ASN1OctetString()), |
| | | noControls, "3", DN.nullDN(), new ASN1OctetString()), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, nullDN, new ASN1OctetString()), |
| | | null, "3", nullDN, new ASN1OctetString()), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, nullDN, new ASN1OctetString()), |
| | | noControls, "3", nullDN, new ASN1OctetString()), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, DN.nullDN(), nullOS), |
| | | null, "3", DN.nullDN(), nullOS), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, DN.nullDN(), nullOS), |
| | | noControls, "3", DN.nullDN(), nullOS), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, nullDN, nullOS), |
| | | null, "3", nullDN, nullOS), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, nullDN, nullOS), |
| | | noControls, "3", nullDN, nullOS), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, DN.decode("cn=Directory Manager"), |
| | | noControls, "3", DN.decode("cn=Directory Manager"), |
| | | new ASN1OctetString("password")) |
| | | }; |
| | | |
| | |
| | | BindOperation[] saslBinds = new BindOperation[] |
| | | { |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, new ASN1OctetString(), "EXTERNAL", null), |
| | | null, "3", new ASN1OctetString(), "EXTERNAL", null), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, new ASN1OctetString(), "EXTERNAL", null), |
| | | noControls, "3", new ASN1OctetString(), "EXTERNAL", |
| | | null), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, nullOS, "EXTERNAL", null), |
| | | null, "3", nullOS, "EXTERNAL", null), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, nullOS, "EXTERNAL", null), |
| | | noControls, "3", nullOS, "EXTERNAL", null), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, new ASN1OctetString(), "PLAIN", |
| | | null, "3", new ASN1OctetString(), "PLAIN", |
| | | new ASN1OctetString("\u0000u:test.user\u0000password")), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, new ASN1OctetString(), "PLAIN", |
| | | noControls, "3", new ASN1OctetString(), "PLAIN", |
| | | new ASN1OctetString("\u0000u:test.user\u0000password")), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, nullOS, "PLAIN", |
| | | null, "3", nullOS, "PLAIN", |
| | | new ASN1OctetString("\u0000u:test.user\u0000password")), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, nullOS, "PLAIN", |
| | | noControls, "3", nullOS, "PLAIN", |
| | | new ASN1OctetString("\u0000u:test.user\u0000password")), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, DN.nullDN(), "EXTERNAL", null), |
| | | null, "3", DN.nullDN(), "EXTERNAL", null), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, DN.nullDN(), "EXTERNAL", null), |
| | | noControls, "3", DN.nullDN(), "EXTERNAL", null), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, nullDN, "EXTERNAL", null), |
| | | null, "3", nullDN, "EXTERNAL", null), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, nullDN, "EXTERNAL", null), |
| | | noControls, "3", nullDN, "EXTERNAL", null), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, DN.nullDN(), "PLAIN", |
| | | null, "3", DN.nullDN(), "PLAIN", |
| | | new ASN1OctetString("\u0000u:test.user\u0000password")), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, DN.nullDN(), "PLAIN", |
| | | noControls, "3", DN.nullDN(), "PLAIN", |
| | | new ASN1OctetString("\u0000u:test.user\u0000password")), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | null, nullDN, "PLAIN", |
| | | null, "3", nullDN, "PLAIN", |
| | | new ASN1OctetString("\u0000u:test.user\u0000password")), |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | noControls, nullDN, "PLAIN", |
| | | noControls, "3", nullDN, "PLAIN", |
| | | new ASN1OctetString("\u0000u:test.user\u0000password")) |
| | | }; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Tests the <CODE>getGetProtocolVersion</CODE> method for simple bind |
| | | * operations. |
| | | * |
| | | * @param o The bind operation to be tested. |
| | | */ |
| | | @Test(dataProvider = "simpleBinds") |
| | | public void testGetProtocolVersionSimple(BindOperation o) |
| | | { |
| | | assertNotNull(o.getProtocolVersion()); |
| | | assertTrue(o.getProtocolVersion().length() > 0); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Tests the <CODE>getProtocolVersion</CODE> method for SASL bind operations. |
| | | * |
| | | * @param o The bind operation to be tested. |
| | | */ |
| | | @Test(dataProvider = "saslBinds") |
| | | public void testGetProtocolVersionSASL(BindOperation o) |
| | | { |
| | | assertNotNull(o.getProtocolVersion()); |
| | | assertTrue(o.getProtocolVersion().length() > 0); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Tests the <CODE>getRawBindDN</CODE> method for simple bind operations. |
| | | * |
| | | * @param o The bind operation to be tested. |
| | |
| | | |
| | | BindOperation bindOperation = |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | requestControls, DN.nullDN(), new ASN1OctetString()); |
| | | requestControls, "3", DN.nullDN(), |
| | | new ASN1OctetString()); |
| | | bindOperation.run(); |
| | | assertEquals(bindOperation.getResultCode(), |
| | | ResultCode.UNAVAILABLE_CRITICAL_EXTENSION); |
| | |
| | | |
| | | BindOperation bindOperation = |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | requestControls, DN.nullDN(), "PLAIN", saslCreds); |
| | | requestControls, "3", DN.nullDN(), "PLAIN", |
| | | saslCreds); |
| | | bindOperation.run(); |
| | | assertEquals(bindOperation.getResultCode(), |
| | | ResultCode.UNAVAILABLE_CRITICAL_EXTENSION); |
| | |
| | | |
| | | BindOperation bindOperation = |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | requestControls, DN.nullDN(), new ASN1OctetString()); |
| | | requestControls, "3", DN.nullDN(), |
| | | new ASN1OctetString()); |
| | | bindOperation.run(); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | |
| | | BindOperation bindOperation = |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | requestControls, DN.nullDN(), "PLAIN", saslCreds); |
| | | requestControls, "3", DN.nullDN(), "PLAIN", |
| | | saslCreds); |
| | | bindOperation.run(); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | BindOperation bindOperation = |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | new ArrayList<Control>(), DN.nullDN(), |
| | | new ArrayList<Control>(), "3", DN.nullDN(), |
| | | SASL_MECHANISM_ANONYMOUS, null); |
| | | handler.processSASLBind(bindOperation); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | BindOperation bindOperation = |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | new ArrayList<Control>(), DN.nullDN(), |
| | | new ArrayList<Control>(), "3", DN.nullDN(), |
| | | SASL_MECHANISM_ANONYMOUS, new ASN1OctetString()); |
| | | handler.processSASLBind(bindOperation); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | BindOperation bindOperation = |
| | | new BindOperation(conn, conn.nextOperationID(), conn.nextMessageID(), |
| | | new ArrayList<Control>(), DN.nullDN(), |
| | | new ArrayList<Control>(), "3", DN.nullDN(), |
| | | SASL_MECHANISM_ANONYMOUS, |
| | | new ASN1OctetString("Internal Trace String")); |
| | | handler.processSASLBind(bindOperation); |