Examples of NetrLogonSamLogon


Examples of org.ntlmv2.liferay.ntlm.msrpc.NetrLogonSamLogon

          domain, 0x00000820, 0, 0, userName, workstation);

      NetlogonNetworkInfo netlogonNetworkInfo = new NetlogonNetworkInfo(
        netlogonIdentityInfo, serverChallenge, ntResponse, lmResponse);

      NetrLogonSamLogon netrLogonSamLogon = new NetrLogonSamLogon(
        _domainControllerName, _ntlmServiceAccount.getComputerName(),
        netlogonAuthenticator, new NetlogonAuthenticator(), 2,
        netlogonNetworkInfo, 2, new NetlogonValidationSamInfo(), 0);

      DcerpcHandle dcerpcHandle = netlogonConnection.getDcerpcHandle();

      dcerpcHandle.sendrecv(netrLogonSamLogon);

      if (netrLogonSamLogon.getStatus() == 0) {
        NetlogonValidationSamInfo netlogonValidationSamInfo =
          netrLogonSamLogon.getNetlogonValidationSamInfo();

        UnicodeString name = new UnicodeString(
          netlogonValidationSamInfo.getEffectiveName(), false);

        return new NtlmUserAccount(name.toString());
      }
      else {
        SmbException smbe = new SmbException(
          netrLogonSamLogon.getStatus(), false);

        throw new NtlmLogonException(
          "Unable to authenticate user: " + smbe.getMessage());
      }
    }
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.