public Executor authPreemptive(final HttpHost host) { if (this.credentialsStore != null) { final Credentials credentials = this.credentialsStore.getCredentials(new AuthScope(host), null); if (credentials == null) { final BasicScheme basicScheme = new BasicScheme(); basicScheme.initPreemptive(credentials); this.authCache.put(host, basicScheme); } } return this; }
private void clearCache(final HttpHost host, final HttpClientContext clientContext) { final AuthCache authCache = clientContext.getAuthCache(); if (authCache != null) { if (this.log.isDebugEnabled()) { this.log.debug("Clearing cached auth scheme for " + host); } authCache.remove(host); } }
final AuthScheme authScheme = authCache.get(target); if (authScheme != null) { if (this.log.isDebugEnabled()) { final AuthExchange proxyAuthExchange = clientContext.getAuthExchange(proxy); if (proxyAuthExchange.getState() == AuthExchange.State.UNCHALLENGED) { final AuthScheme authScheme = authCache.get(proxy); if (authScheme != null) { if (this.log.isDebugEnabled()) {
public Executor authPreemptiveProxy(final HttpHost proxy) { if (this.credentialsStore != null) { final Credentials credentials = this.credentialsStore.getCredentials(new AuthScope(proxy), null); if (credentials == null) { final BasicScheme basicScheme = new BasicScheme(); basicScheme.initPreemptive(credentials); this.authCache.put(proxy, basicScheme); } } return this; }
private void updateCache(final HttpHost host, final AuthScheme authScheme, final HttpClientContext clientContext) { final boolean cachable = authScheme.getClass().getAnnotation(AuthStateCacheable.class) != null; if (cachable) { AuthCache authCache = clientContext.getAuthCache(); if (authCache == null) { authCache = new BasicAuthCache(); clientContext.setAuthCache(authCache); } if (this.log.isDebugEnabled()) { this.log.debug("Caching '" + authScheme.getName() + "' auth scheme for " + host); } authCache.put(host, authScheme); } }
public Executor authPreemptive(final HttpHost host) { if (this.credentialsStore != null) { final Credentials credentials = this.credentialsStore.getCredentials(new AuthScope(host), null); if (credentials == null) { final BasicScheme basicScheme = new BasicScheme(); basicScheme.initPreemptive(credentials); this.authCache.put(host, basicScheme); } } return this; }
public Executor authPreemptiveProxy(final HttpHost proxy) { if (this.credentialsStore != null) { final Credentials credentials = this.credentialsStore.getCredentials(new AuthScope(proxy), null); if (credentials == null) { final BasicScheme basicScheme = new BasicScheme(); basicScheme.initPreemptive(credentials); this.authCache.put(proxy, basicScheme); } } return this; }