Examples of NTCredentials


Examples of org.apache.http.auth.NTCredentials

      localHttpClient.setRedirectStrategy(new DefaultRedirectStrategy());
      // Set up authentication to use
      if (ingestNtlmDomain != null)
      {
        localHttpClient.getCredentialsProvider().setCredentials(AuthScope.ANY,
          new NTCredentials(ingestNtlmUsername,ingestNtlmPassword,currentHost,ingestNtlmDomain));
      }
      httpClient = localHttpClient;
     
      // System.out.println("Connection server object = "+llServer.toString());
View Full Code Here

Examples of org.apache.http.auth.NTCredentials

    localDmwsHttpClient.setRedirectStrategy(new DefaultRedirectStrategy());
    if (domainUser != null)
    {
      localDmwsHttpClient.getCredentialsProvider().setCredentials(
        new AuthScope(meridioDmwsUrl.getHost(),meridioDmwsUrl.getPort()),
        new NTCredentials(domainUser, password, currentHost, domain));
    }
    // Initialize proxy
    if (dmwsProxyHost != null && dmwsProxyHost.length() > 0)
    {
      int port = (dmwsProxyPort == null || dmwsProxyPort.length() == 0)?8080:Integer.parseInt(dmwsProxyPort);
      // Configure proxy authentication
      if (domainUser != null && domainUser.length() > 0)
      {
        localDmwsHttpClient.getCredentialsProvider().setCredentials(
          new AuthScope(dmwsProxyHost, port),
          new NTCredentials(domainUser, password, currentHost, domain));
      }

      HttpHost proxy = new HttpHost(dmwsProxyHost, port);
      localDmwsHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
    }
    dmwsHttpClient = localDmwsHttpClient;
   
    // rmws
    BasicHttpParams rmwsParams = new BasicHttpParams();
    rmwsParams.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY,true);
    rmwsParams.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK,true);
    rmwsParams.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,60000);
    rmwsParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,900000);
    rmwsParams.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS,true);
    DefaultHttpClient localRmwsHttpClient = new DefaultHttpClient(connectionManager,rmwsParams);
    // No retries
    localRmwsHttpClient.setHttpRequestRetryHandler(new HttpRequestRetryHandler()
      {
  public boolean retryRequest(
    IOException exception,
    int executionCount,
          HttpContext context)
  {
    return false;
  }
    
      });

    localRmwsHttpClient.setRedirectStrategy(new DefaultRedirectStrategy());
    if (domainUser != null)
    {
      localRmwsHttpClient.getCredentialsProvider().setCredentials(
        new AuthScope(meridioRmwsUrl.getHost(),meridioRmwsUrl.getPort()),
        new NTCredentials(domainUser, password, currentHost, domain));
    }
    // Initialize proxy
    if (rmwsProxyHost != null && rmwsProxyHost.length() > 0)
    {
      int port = (rmwsProxyPort == null || rmwsProxyPort.length() == 0)?8080:Integer.parseInt(rmwsProxyPort);
      // Configure proxy authentication
      if (domainUser != null && domainUser.length() > 0)
      {
        localRmwsHttpClient.getCredentialsProvider().setCredentials(
          new AuthScope(rmwsProxyHost, port),
          new NTCredentials(domainUser, password, currentHost, domain));
      }

      HttpHost proxy = new HttpHost(rmwsProxyHost, port);
      localRmwsHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
    }
    rmwsHttpClient = localRmwsHttpClient;

    // mcws
    if (meridioManifoldCFWSUrl != null)
    {
      BasicHttpParams mcwsParams = new BasicHttpParams();
      mcwsParams.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY,true);
      mcwsParams.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK,true);
      mcwsParams.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,60000);
      mcwsParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,900000);
      mcwsParams.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS,true);
      DefaultHttpClient localMcwsHttpClient = new DefaultHttpClient(connectionManager,mcwsParams);
      // No retries
      localMcwsHttpClient.setHttpRequestRetryHandler(new HttpRequestRetryHandler()
        {
          public boolean retryRequest(
            IOException exception,
            int executionCount,
            HttpContext context)
          {
            return false;
          }
      
        });

      localMcwsHttpClient.setRedirectStrategy(new DefaultRedirectStrategy());
      if (domainUser != null)
      {
        localMcwsHttpClient.getCredentialsProvider().setCredentials(
          new AuthScope(meridioManifoldCFWSUrl.getHost(),meridioManifoldCFWSUrl.getPort()),
          new NTCredentials(domainUser, password, currentHost, domain));
      }
      // Initialize proxy
      if (mcwsProxyHost != null && mcwsProxyHost.length() > 0)
      {
        int port = (mcwsProxyPort == null || mcwsProxyPort.length() == 0)?8080:Integer.parseInt(mcwsProxyPort);
        // Configure proxy authentication
        if (domainUser != null && domainUser.length() > 0)
        {
          localMcwsHttpClient.getCredentialsProvider().setCredentials(
            new AuthScope(mcwsProxyHost, port),
            new NTCredentials(domainUser, password, currentHost, domain));
        }

        HttpHost proxy = new HttpHost(mcwsProxyHost, port);
        localMcwsHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
      }
View Full Code Here

Examples of org.apache.http.auth.NTCredentials

      localHttpClient.setRedirectStrategy(new DefaultRedirectStrategy());
      if (strippedUserName != null)
      {
        localHttpClient.getCredentialsProvider().setCredentials(
          new AuthScope(serverName,serverPort),
          new NTCredentials(strippedUserName, password, currentHost, ntlmDomain));
      }

      httpClient = localHttpClient;
     
      proxy = new SPSProxyHelper( serverUrl, encodedServerLocation, serverLocation, userName, password,
View Full Code Here

Examples of org.apache.http.auth.NTCredentials

          if (proxyAuthDomain == null)
            proxyAuthDomain = "";

          localHttpClient.getCredentialsProvider().setCredentials(
            new AuthScope(proxyHost, proxyPort),
            new NTCredentials(proxyAuthUsername, proxyAuthPassword, currentHost, proxyAuthDomain));
        }

        HttpHost proxy = new HttpHost(proxyHost, proxyPort);

        localHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
View Full Code Here

Examples of org.apache.http.auth.NTCredentials

        if (proxyDomain == null)
          proxyDomain = "";

        localHttpClient.getCredentialsProvider().setCredentials(
          new AuthScope(proxyHost, proxyPortInt),
          new NTCredentials(proxyUsername, proxyPassword, currentHost, proxyDomain));
      }

      HttpHost proxy = new HttpHost(proxyHost, proxyPortInt);

      localHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
View Full Code Here

Examples of org.apache.http.auth.NTCredentials

        if (proxyDomain == null)
          proxyDomain = "";

        localHttpClient.getCredentialsProvider().setCredentials(
          new AuthScope(proxyHost, proxyPortInt),
          new NTCredentials(proxyUsername, proxyPassword, currentHost, proxyDomain));
      }

      HttpHost proxy = new HttpHost(proxyHost, proxyPortInt);

      localHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
View Full Code Here

Examples of org.apache.http.auth.NTCredentials

    }

    public Header authenticate(
            final Credentials credentials,
            final HttpRequest request) throws AuthenticationException {
        NTCredentials ntcredentials = null;
        try {
            ntcredentials = (NTCredentials) credentials;
        } catch (ClassCastException e) {
            throw new InvalidCredentialsException(
             "Credentials cannot be used for NTLM authentication: "
              + credentials.getClass().getName());
        }
        String response = null;
        if (this.state == State.CHALLENGE_RECEIVED || this.state == State.FAILED) {
            response = this.engine.generateType1Msg(
                    ntcredentials.getDomain(),
                    ntcredentials.getWorkstation());
            this.state = State.MSG_TYPE1_GENERATED;
        } else if (this.state == State.MSG_TYPE2_RECEVIED) {
            response = this.engine.generateType3Msg(
                    ntcredentials.getUserName(),
                    ntcredentials.getPassword(),
                    ntcredentials.getDomain(),
                    ntcredentials.getWorkstation(),
                    this.challenge);
            this.state = State.MSG_TYPE3_GENERATED;
        } else {
            throw new AuthenticationException("Unexpected state: " + this.state);
        }
View Full Code Here

Examples of org.apache.http.auth.NTCredentials

    }

    public Header authenticate(
            final Credentials credentials,
            final HttpRequest request) throws AuthenticationException {
        NTCredentials ntcredentials = null;
        try {
            ntcredentials = (NTCredentials) credentials;
        } catch (ClassCastException e) {
            throw new InvalidCredentialsException(
             "Credentials cannot be used for NTLM authentication: "
              + credentials.getClass().getName());
        }
        String response = null;
        if (this.state == State.CHALLENGE_RECEIVED || this.state == State.FAILED) {
            response = this.engine.generateType1Msg(
                    ntcredentials.getDomain(),
                    ntcredentials.getWorkstation());
            this.state = State.MSG_TYPE1_GENERATED;
        } else if (this.state == State.MSG_TYPE2_RECEVIED) {
            response = this.engine.generateType3Msg(
                    ntcredentials.getUserName(),
                    ntcredentials.getPassword(),
                    ntcredentials.getDomain(),
                    ntcredentials.getWorkstation(),
                    this.challenge);
            this.state = State.MSG_TYPE3_GENERATED;
        } else {
            throw new AuthenticationException("Unexpected state: " + this.state);
        }
View Full Code Here

Examples of org.apache.http.auth.NTCredentials

    }

    public Header authenticate(
            final Credentials credentials,
            final HttpRequest request) throws AuthenticationException {
        NTCredentials ntcredentials = null;
        try {
            ntcredentials = (NTCredentials) credentials;
        } catch (ClassCastException e) {
            throw new InvalidCredentialsException(
             "Credentials cannot be used for NTLM authentication: "
              + credentials.getClass().getName());
        }
        String response = null;
        if (this.state == State.CHALLENGE_RECEIVED || this.state == State.FAILED) {
            response = this.engine.generateType1Msg(
                    ntcredentials.getDomain(),
                    ntcredentials.getWorkstation());
            this.state = State.MSG_TYPE1_GENERATED;
        } else if (this.state == State.MSG_TYPE2_RECEVIED) {
            response = this.engine.generateType3Msg(
                    ntcredentials.getUserName(),
                    ntcredentials.getPassword(),
                    ntcredentials.getDomain(),
                    ntcredentials.getWorkstation(),
                    this.challenge);
            this.state = State.MSG_TYPE3_GENERATED;
        } else {
            throw new AuthenticationException("Unexpected state: " + this.state);
        }
View Full Code Here

Examples of org.apache.http.auth.NTCredentials

                if ( proxyUsername != null && proxyPassword != null )
                {
                    Credentials creds;
                    if ( proxyNtlmHost != null || proxyNtlmDomain != null )
                    {
                        creds = new NTCredentials( proxyUsername, proxyPassword, proxyNtlmHost, proxyNtlmDomain );
                    }
                    else
                    {
                        creds = new UsernamePasswordCredentials( proxyUsername, proxyPassword );
                    }
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.