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");
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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);
    } 
     
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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();
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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>();
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android BasicScheme Questions & Answers:

See Code Examples for Android BasicScheme Methods: