Code example for AuthState

Methods: getAuthScheme

0
			CredentialsProvider credsProvider = (CredentialsProvider) context 
					.getAttribute(ClientContext.CREDS_PROVIDER); 
			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); 
				} 
			} 
		} 
	}; 
 
	/* 
	 * sends the request and retrieve the response 
	 *  
Connect your IDE to all the code out there  Get Codota for Java