Code example for AuthState

Methods: getAuthScheme, getAuthScope, getCredentials

0
                ClientContext.PROXY_AUTH_STATE);
        if (authState == null) {
            return; 
        } 
 
        AuthScheme authScheme = authState.getAuthScheme();
        if (authScheme == null) {
            return; 
        } 
         
        Credentials creds = authState.getCredentials();
        if (creds == null) {
            this.log.debug("User credentials not available");
            return; 
        } 
        if (authState.getAuthScope() != null || !authScheme.isConnectionBased()) {
            try { 
                request.addHeader(authScheme.authenticate(creds, request));
            } catch (AuthenticationException ex) {
                if (this.log.isErrorEnabled()) {
                    this.log.error("Proxy authentication error: " + ex.getMessage());