Android BasicSchemeFactory - 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 BasicSchemeFactory class.

This code example shows how to use the following methods:
	@Override 
    protected AuthSchemeRegistry createAuthSchemeRegistry() {
        AuthSchemeRegistry registry = new AuthSchemeRegistry();
        registry.register(
                AuthPolicy.BASIC,
                new BasicSchemeFactory());
        registry.register(
                AuthPolicy.DIGEST,
                new EnhancedDigestSchemeFactory()); 
        return registry;
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:
        Map<String, Header> challenges = new HashMap<String, Header>();
        challenges.put("basic", new BasicHeader(AUTH.WWW_AUTH, "Basic realm=\"test\""));
        challenges.put("digest", new BasicHeader(AUTH.WWW_AUTH, "Digest realm=\"realm1\", nonce=\"1234\""));
 
        AuthSchemeRegistry authSchemeRegistry = new AuthSchemeRegistry();
        authSchemeRegistry.register("basic", new BasicSchemeFactory());
        authSchemeRegistry.register("digest", new DigestSchemeFactory());
        context.setAttribute(ClientContext.AUTHSCHEME_REGISTRY, authSchemeRegistry);
 
        Queue<AuthOption> options = authStrategy.select(challenges, authhost, response, context);
        Assert.assertNotNull(options);
        Assert.assertEquals(0, options.size());
    } 
 
    @Test 
    public void testNoCredentials() throws Exception { 
        TargetAuthenticationStrategy authStrategy = new TargetAuthenticationStrategy();
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
        HttpHost authhost = new HttpHost("locahost", 80);
        HttpContext context = new BasicHttpContext();
3
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	@Override 
    protected AuthSchemeRegistry createAuthSchemeRegistry() {
        AuthSchemeRegistry registry = new AuthSchemeRegistry();
        registry.register(
                AuthPolicy.BASIC,
                new BasicSchemeFactory());
        registry.register(
                AuthPolicy.DIGEST,
                new EnhancedDigestSchemeFactory()); 
        return registry;
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	@Override 
    protected AuthSchemeRegistry createAuthSchemeRegistry() {
        AuthSchemeRegistry registry = new AuthSchemeRegistry();
        registry.register(
                AuthPolicy.BASIC,
                new BasicSchemeFactory());
        registry.register(
                AuthPolicy.DIGEST,
                new EnhancedDigestSchemeFactory()); 
        return registry;
    } 
 
} 
4
CodeRank
See Code Examples for Android BasicSchemeFactory Methods: