@Deprecated static public void setGlobalCredentialsProvider(CredentialsProvider provider, String scheme) throws HTTPException { setGlobalCredentialsProvider(provider); }
@Deprecated static public void setGlobalCredentialsProvider(AuthScope scope, CredentialsProvider provider) throws HTTPException { setGlobalCredentialsProvider(provider, scope); }
/** * @param provider * @throws HTTPException */ @Deprecated static public void setGlobalCredentialsProvider(CredentialsProvider provider) throws HTTPException { setGlobalCredentialsProvider(provider, (AuthScope) null); }
/** * It is convenient to be able to directly set the Credentials * (not the provider) when those credentials are fixed. * * @param creds * @param scope where to use it (i.e. on what host) * @throws HTTPException */ static public void setGlobalCredentials(Credentials creds, AuthScope scope) throws HTTPException { assert (creds != null); if(scope == null) scope = AuthScope.ANY; CredentialsProvider provider = new BasicCredentialsProvider(); provider.setCredentials(scope, creds); setGlobalCredentialsProvider(provider, scope); }
@Deprecated static public void setGlobalCredentials(String url, Credentials creds) throws HTTPException { assert (url != null && creds != null); AuthScope scope = HTTPAuthUtil.uriToAuthScope(url); CredentialsProvider provider = new BasicCredentialsProvider(); provider.setCredentials(scope, creds); setGlobalCredentialsProvider(provider, scope); }
@Deprecated static public void setGlobalCredentialsProvider(String url, CredentialsProvider provider) throws HTTPException { assert (url != null && provider != null); AuthScope scope = HTTPAuthUtil.uriToAuthScope(url); setGlobalCredentialsProvider(provider, scope); }
static public void setGlobalCredentials(AuthScope scope, Credentials creds) { CredentialsProvider provider = new HTTPConstantProvider(creds); setGlobalCredentialsProvider(scope, provider); }
static synchronized void setGlobalKeyStore() { String keypassword = cleanproperty("keystorepassword"); String keypath = cleanproperty("keystore"); String trustpassword = cleanproperty("truststorepassword"); String trustpath = cleanproperty("truststore"); if(keypath != null || trustpath != null) { // define conditionally HTTPSSLProvider sslprovider = new HTTPSSLProvider(keypath, keypassword, trustpath, trustpassword); setGlobalCredentialsProvider( new AuthScope(ANY_HOST, ANY_PORT, ANY_REALM, HTTPAuthPolicy.SSL), sslprovider); } }
HTTPSession.setGlobalCredentialsProvider(provider);