Android BasicScheme - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android BasicScheme class.

This code example shows how to use the following methods:
 
                            if (authState.getAuthScheme() == null) {
                                AuthScope authScope = new AuthScope(
                                        targetHost.getHostName(),
                                        targetHost.getPort());
                                authState.setAuthScheme(new BasicScheme());
                                authState.setCredentials(creds);
                            } 
                        } 
                    }; 
 
                    dhc.addRequestInterceptor(preemptiveAuth, 0);
                } 
            } else { 
                Log.w(TDDatabase.TAG,
                        "Unable to parse user info, not setting credentials"); 
            } 
        } 
 
        request.addHeader("Accept", "application/json");
6
CodeRank
This code example shows how to use the following methods:processChallenge
        this.proxycreds = proxycreds;
    } 
 
    public void authenticatePreemptively( 
            final HttpRequest request, final HttpContext context) throws ProtocolException {
        BasicScheme basicScheme = new BasicScheme();
        basicScheme.processChallenge(new BasicHeader(AUTH.PROXY_AUTH, "BASIC realm=\"proxy\""));
        Header authresp = basicScheme.authenticate(proxycreds, request, context);
        request.addHeader(authresp);
    } 
     
} 
5
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
    } 
 
    private InputStream getResponse() throws AuthenticationException, ClientProtocolException, IOException {
        HttpResponse response = null;
 
        httpGet.addHeader(new BasicScheme().authenticate(creds, httpGet));
        httpGet.addHeader("content-type", "application/xml");
        response = client.execute(httpGet);
 
        HttpEntity entity = response.getEntity();
        return entity.getContent();
    } 
 
    private void processXMLDocument(InputStream content) throws Exception {
        state = State.SAVING;
 
        XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
        factory.setNamespaceAware(true);
 
        XmlPullParser parser = factory.newPullParser();
3
CodeRank
This code example shows how to use the following methods:
      HttpHost targetHost = (HttpHost)context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
      if (authState.getAuthScheme() == null) {
        AuthScope authScope = new AuthScope(targetHost.getHostName(), targetHost.getPort());
        Credentials creds = credsProvider.getCredentials(authScope);
        if (creds != null) {
          authState.setAuthScheme(new BasicScheme());
          authState.setCredentials(creds);
        } 
      } 
    } 
  } 
 
  /** 
   * @author Patrick Woodworth 
   */ 
  static class WeaveHostnameVerifier extends AbstractVerifier {
 
    public void verify(String host, String[] cns, String[] subjectAlts) throws SSLException {
      if (isIPAddress(host) && cns != null && cns.length > 0 && cns[0] != null) {
        HashSet<String> expandedAlts = new HashSet<String>();
3
CodeRank
This code example shows how to use the following methods:
                                        ClientContext.CREDS_PROVIDER);
                                HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
 
                                if (authState.getAuthScheme() == null) {
                                    AuthScope authScope = new AuthScope(targetHost.getHostName(), targetHost.getPort());
                                    authState.setAuthScheme(new BasicScheme());
                                    authState.setCredentials(creds);
                                } 
                            } 
                        }; 
 
                        dhc.addRequestInterceptor(preemptiveAuth, 0);
                    } 
                } 
                else { 
                    Log.w(CBLDatabase.TAG, "Unable to parse user info, not setting credentials");
                } 
            } 
 
            try { 
3
CodeRank
This code example shows how to use the following methods:
                                        ClientContext.CREDS_PROVIDER);
                                HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
 
                                if (authState.getAuthScheme() == null) {
                                    AuthScope authScope = new AuthScope(targetHost.getHostName(), targetHost.getPort());
                                    authState.setAuthScheme(new BasicScheme());
                                    authState.setCredentials(creds);
                                } 
                            } 
                        }; 
 
                        dhc.addRequestInterceptor(preemptiveAuth, 0);
                    } 
                } else { 
                    Log.w(CBLDatabase.TAG, "ChangeTracker Unable to parse user info, not setting credentials");
                } 
            } 
 
            try { 
                String maskedRemoteWithoutCredentials = getChangesFeedURL().toString();
3
CodeRank
This code example shows how to use the following methods:
                                        ClientContext.CREDS_PROVIDER);
                                HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
 
                                if (authState.getAuthScheme() == null) {
                                    AuthScope authScope = new AuthScope(targetHost.getHostName(), targetHost.getPort());
                                    authState.setAuthScheme(new BasicScheme());
                                    authState.setCredentials(creds);
                                } 
                            } 
                        }; 
 
                        dhc.addRequestInterceptor(preemptiveAuth, 0);
                    } 
                } 
                else { 
                    Log.w(TDDatabase.TAG, "Unable to parse user info, not setting credentials");
                } 
            } 
 
            try { 
3
CodeRank
This code example shows how to use the following methods:
				if (authState.getAuthScheme() == null) {
					AuthScope authScope = new AuthScope(
							targetHost.getHostName(), targetHost.getPort());
					Credentials creds = credsProvider.getCredentials(authScope);
					if (creds != null) {
						authState.setAuthScheme(new BasicScheme());
						authState.setCredentials(creds);
					} 
				} 
			} 
		}; 
 
		((AbstractHttpClient) httpClient).addRequestInterceptor(preemptiveAuth,
				0); 
	} 
 
	/** 
	 * extract the domain and if specified the port number to create an 
	 * authorization scope to use with HTTP Request authorization 
	 *  
4
CodeRank
This code example shows how to use the following methods:

Related Android BasicScheme Questions & Answers:

See Code Examples for Android BasicScheme Methods: