Examples of BindOperationBasis


Examples of org.nasutekds.server.core.BindOperationBasis

    AnonymousSASLMechanismHandler handler = new AnonymousSASLMechanismHandler();
    handler.initializeSASLMechanismHandler(null);

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    BindOperationBasis bindOperation =
         new BindOperationBasis(conn, conn.nextOperationID(), conn.nextMessageID(),
                           new ArrayList<Control>(), "3", DN.nullDN(),
                           SASL_MECHANISM_ANONYMOUS, null);
    handler.processSASLBind(bindOperation);
    assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);

    handler.finalizeSASLMechanismHandler();
  }
View Full Code Here

Examples of org.nasutekds.server.core.BindOperationBasis

    AnonymousSASLMechanismHandler handler = new AnonymousSASLMechanismHandler();
    handler.initializeSASLMechanismHandler(null);

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    BindOperationBasis bindOperation =
         new BindOperationBasis(conn, conn.nextOperationID(), conn.nextMessageID(),
                           new ArrayList<Control>(), "3", DN.nullDN(),
                           SASL_MECHANISM_ANONYMOUS, ByteString.empty());
    handler.processSASLBind(bindOperation);
    assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);

    handler.finalizeSASLMechanismHandler();
  }
View Full Code Here

Examples of org.nasutekds.server.core.BindOperationBasis

    AnonymousSASLMechanismHandler handler = new AnonymousSASLMechanismHandler();
    handler.initializeSASLMechanismHandler(null);

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    BindOperationBasis bindOperation =
         new BindOperationBasis(conn, conn.nextOperationID(), conn.nextMessageID(),
                           new ArrayList<Control>(), "3", DN.nullDN(),
                           SASL_MECHANISM_ANONYMOUS,
                           ByteString.valueOf("Internal Trace String"));
    handler.processSASLBind(bindOperation);
    assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);

    handler.finalizeSASLMechanismHandler();
  }
View Full Code Here

Examples of org.nasutekds.server.core.BindOperationBasis

    AuthenticationInfo authInfo = new AuthenticationInfo();
    JmxClientConnection jmxClientConnection = new JmxClientConnection(
        jmxConnectionHandler, authInfo);

    BindOperationBasis bindOp = new BindOperationBasis(jmxClientConnection,
        jmxClientConnection.nextOperationID(),
        jmxClientConnection.nextMessageID(), requestControls,
        jmxConnectionHandler.getRMIConnector().getProtocolVersion(),
        ByteString.valueOf(authcID), bindPW);

    bindOp.run();
    if (bindOp.getResultCode() == ResultCode.SUCCESS)
    {
      if (debugEnabled())
      {
        TRACER.debugVerbose("User is authenticated");
      }

      authInfo = bindOp.getAuthenticationInfo();
      jmxClientConnection.setAuthenticationInfo(authInfo);

      // Check JMX_READ privilege.
      if (! jmxClientConnection.hasPrivilege(Privilege.JMX_READ, null))
      {
        Message message = ERR_JMX_INSUFFICIENT_PRIVILEGES.get();

        jmxClientConnection.disconnect(DisconnectReason.CONNECTION_REJECTED,
            false, message);

        throw new SecurityException(message.toString());
      }
      return jmxClientConnection;
    }
    else
    {
      //
      // Set the initcause.
      LDAPException ldapEx = new LDAPException(
          LDAPResultCode.INVALID_CREDENTIALS,
          CoreMessages.INFO_RESULT_INVALID_CREDENTIALS.get());
      SecurityException se = new SecurityException("return code: "
          + bindOp.getResultCode());
      se.initCause(ldapEx);
      throw se;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.