AuthState setAuthScheme - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for AuthState setAuthScheme method.

This code example shows how to use the following methods:getAuthScheme, setAuthScheme, setCredentials
This code example shows how to use the following methods:getAuthScheme, setAuthScheme
            final AuthenticationHandler authHandler,
            final HttpResponse response,
            final HttpContext context)
                throws MalformedChallengeException, AuthenticationException { 
 
        AuthScheme authScheme = authState.getAuthScheme();
        if (authScheme == null) {
            // Authentication not attempted before 
            authScheme = authHandler.selectScheme(challenges, response, context);
            authState.setAuthScheme(authScheme);
        } 
        String id = authScheme.getSchemeName();
 
        Header challenge = challenges.get(id.toLowerCase(Locale.ENGLISH));
        if (challenge == null) {
            throw new AuthenticationException(id +
                " authorization challenge expected, but not found"); 
        } 
        authScheme.processChallenge(challenge);
        if (DEBUG) {
3
CodeRank
setAuthScheme Method Overview
Assigns the given authentication scheme.
See Code Examples for other Android AuthState Methods: