Package org.apache.http.auth

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


                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

            {
                Credentials creds;
                if ( proxyInfo.getNtlmHost() != null || proxyInfo.getNtlmDomain() != null )
                {
                    creds =
                        new NTCredentials( proxyInfo.getUserName(), proxyInfo.getPassword(), proxyInfo.getNtlmHost(),
                                           proxyInfo.getNtlmDomain() );
                }
                else
                {
                    creds = new UsernamePasswordCredentials( proxyInfo.getUserName(), proxyInfo.getPassword() );
View Full Code Here

      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

      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

          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

        final AuthState targetAuthState = new AuthState();
        targetAuthState.setState(AuthProtocolState.SUCCESS);
        targetAuthState.update(new BasicScheme(), new UsernamePasswordCredentials("user:pass"));
        final AuthState proxyAuthState = new AuthState();
        proxyAuthState.setState(AuthProtocolState.SUCCESS);
        proxyAuthState.update(new NTLMScheme(), new NTCredentials("user:pass"));
        context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, targetAuthState);
        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, proxyAuthState);

        final CloseableHttpResponse response1 = Mockito.mock(CloseableHttpResponse.class);
        final CloseableHttpResponse response2 = Mockito.mock(CloseableHttpResponse.class);
View Full Code Here

                .setStream(instream2)
                .build());

        final AuthState proxyAuthState = new AuthState();
        proxyAuthState.setState(AuthProtocolState.SUCCESS);
        proxyAuthState.update(new NTLMScheme(), new NTCredentials("user:pass"));

        final HttpClientContext context = new HttpClientContext();
        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, proxyAuthState);

        Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
View Full Code Here

      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

        this.domain = domain;
    }

    @Override
    protected Credentials createCredentials(URI target) {
        return new NTCredentials(this.getUserName(target), new String(this.getPassword(target)), this.workstation, this.domain);
    }
View Full Code Here

TOP

Related Classes of org.apache.http.auth.NTCredentials

Copyright © 2018 www.massapicom. 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.