Package org.apache.http.impl.auth

Examples of org.apache.http.impl.auth.BasicScheme


        HttpHost targethost = getServerHttp();

        HttpContext context = new BasicHttpContext();
        AuthCache authCache = new BasicAuthCache();
        authCache.put(targethost, new BasicScheme());
        context.setAttribute(ClientContext.AUTH_CACHE, authCache);

        HttpGet httpget = new HttpGet("/");

        HttpResponse response1 = this.httpclient.execute(targethost, httpget, context);
View Full Code Here


        HttpHost targethost = getServerHttp();

        HttpContext context = new BasicHttpContext();
        AuthCache authCache = new BasicAuthCache();
        authCache.put(targethost, new BasicScheme());
        context.setAttribute(ClientContext.AUTH_CACHE, authCache);

        HttpGet httpget = new HttpGet("/");

        HttpResponse response1 = this.httpclient.execute(targethost, httpget, context);
View Full Code Here

                }

                String userinfo = wrapper.getURI().getUserInfo();
                if (userinfo != null) {
                    targetAuthState.update(
                            new BasicScheme(), new UsernamePasswordCredentials(userinfo));
                }

                HttpHost proxy = route.getProxyHost();
                if (virtualHost != null) {
                    target = virtualHost;
View Full Code Here

            int port = url.getPort() > -1 ? url.getPort() : AuthScope.ANY_PORT;

            httpClient.getCredentialsProvider().setCredentials( new AuthScope( host, port ), creds );

            AuthCache authCache = new BasicAuthCache();
            BasicScheme basicAuth = new BasicScheme();
            HttpHost targetHost = new HttpHost( url.getHost(), url.getPort(), url.getProtocol() );
            authCache.put( targetHost, basicAuth );

            localContext = new BasicHttpContext();
            localContext.setAttribute( ClientContext.AUTH_CACHE, authCache );
View Full Code Here

                }

                String userinfo = wrapper.getURI().getUserInfo();
                if (userinfo != null) {
                    targetAuthState.update(
                            new BasicScheme(), new UsernamePasswordCredentials(userinfo));
                }

                // Reset headers on the request wrapper
                wrapper.resetHeaders();
View Full Code Here

                }

                String userinfo = wrapper.getURI().getUserInfo();
                if (userinfo != null) {
                    targetAuthState.update(
                            new BasicScheme(), new UsernamePasswordCredentials(userinfo));
                }

                // Reset headers on the request wrapper
                wrapper.resetHeaders();
View Full Code Here

        HttpHost targethost = getServerHttp();

        HttpContext context = new BasicHttpContext();
        AuthCache authCache = new BasicAuthCache();
        authCache.put(targethost, new BasicScheme());
        context.setAttribute(ClientContext.AUTH_CACHE, authCache);

        HttpGet httpget = new HttpGet("/");

        HttpResponse response1 = this.httpclient.execute(targethost, httpget, context);
View Full Code Here

        HttpHost targethost = getServerHttp();

        HttpContext context = new BasicHttpContext();
        AuthCache authCache = new BasicAuthCache();
        authCache.put(targethost, new BasicScheme());
        context.setAttribute(ClientContext.AUTH_CACHE, authCache);

        HttpGet httpget = new HttpGet("/");

        HttpResponse response1 = this.httpclient.execute(targethost, httpget, context);
View Full Code Here

            int port = url.getPort() > -1 ? url.getPort() : AuthScope.ANY_PORT;

            httpClient.getCredentialsProvider().setCredentials( new AuthScope( host, port ), creds );

            AuthCache authCache = new BasicAuthCache();
            BasicScheme basicAuth = new BasicScheme();
            HttpHost targetHost = new HttpHost( url.getHost(), url.getPort(), url.getProtocol() );
            authCache.put( targetHost, basicAuth );

            localContext = new BasicHttpContext();
            localContext.setAttribute( ClientContext.AUTH_CACHE, authCache );
View Full Code Here

        if( user != null && user.length() > 0 ) {
            client.getCredentialsProvider().setCredentials( AuthScope.ANY, new UsernamePasswordCredentials( user, password ) );

            // All this bollocks is just for pre-emptive authentication. It used to be a boolean...
            BasicHttpContext localcontext = new BasicHttpContext();
            BasicScheme basicAuth = new BasicScheme();
            localcontext.setAttribute( "preemptive-auth", basicAuth );
            client.addRequestInterceptor( new PreemptiveAuth(), 0 );
        }

        HttpPost post = new HttpPost( url );
View Full Code Here

TOP

Related Classes of org.apache.http.impl.auth.BasicScheme

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.