public Executor auth(final HttpHost host, final Credentials creds) { return auth(new AuthScope(host), creds); }
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; }
public Executor auth(final HttpHost host, final Credentials creds) { return auth(new AuthScope(host), creds); }
public static void extractFromAuthority( final String scheme, final URIAuthority authority, final CredentialsStore credentialsStore) { Args.notNull(credentialsStore, "Credentials store"); if (authority == null) { return; } final String userinfo = authority.getUserInfo(); if (userinfo == null) { return; } final int atColon = userinfo.indexOf(':'); final String userName; final char[] password; if (atColon >= 0) { userName = userinfo.substring(0, atColon); password = userinfo.substring(atColon + 1).toCharArray(); } else { userName = userinfo.substring(0, atColon); password = null; } credentialsStore.setCredentials( new AuthScope(scheme, authority.getHostName(), authority.getPort(), null, AuthSchemes.BASIC.ident), new UsernamePasswordCredentials(userName, password)); }
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; }
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; }
@Override public boolean isResponseReady( final HttpHost host, final CredentialsProvider credentialsProvider, final HttpContext context) throws AuthenticationException { Args.notNull(host, "Auth host"); Args.notNull(credentialsProvider, "CredentialsProvider"); final Credentials credentials = credentialsProvider.getCredentials( new AuthScope(host, null, getName()), context); if (credentials instanceof NTCredentials) { this.credentials = (NTCredentials) credentials; return true; } return false; }
@Override public boolean isResponseReady( final HttpHost host, final CredentialsProvider credentialsProvider, final HttpContext context) throws AuthenticationException { Args.notNull(host, "Auth host"); Args.notNull(credentialsProvider, "CredentialsProvider"); final Credentials credentials = credentialsProvider.getCredentials( new AuthScope(host, null, getName()), context); if (credentials instanceof KerberosCredentials) { this.gssCredential = ((KerberosCredentials) credentials).getGSSCredential(); } else { this.gssCredential = null; } return true; }
@Override public boolean isResponseReady( final HttpHost host, final CredentialsProvider credentialsProvider, final HttpContext context) throws AuthenticationException { Args.notNull(host, "Auth host"); Args.notNull(credentialsProvider, "CredentialsProvider"); final Credentials credentials = credentialsProvider.getCredentials( new AuthScope(host, getRealm(), getName()), context); if (credentials != null) { this.username = credentials.getUserPrincipal().getName(); this.password = credentials.getPassword(); return true; } this.username = null; this.password = null; return false; }
@Override public boolean isResponseReady( final HttpHost host, final CredentialsProvider credentialsProvider, final HttpContext context) throws AuthenticationException { Args.notNull(host, "Auth host"); Args.notNull(credentialsProvider, "CredentialsProvider"); final Credentials credentials = credentialsProvider.getCredentials( new AuthScope(host, getRealm(), getName()), context); if (credentials != null) { this.username = credentials.getUserPrincipal().getName(); this.password = credentials.getPassword(); return true; } this.username = null; this.password = null; return false; }
if (proxyPort != null) { try { final AuthScope systemScope = new AuthScope(proxyHost, Integer.parseInt(proxyPort)); if (authscope.match(systemScope) >= 0) { final String proxyUser = System.getProperty(protocol + ".proxyUser");
credsProvider.setCredentials(new AuthScope(proxy), credentials);