protected void setCredentials(XmlRpcHttpClientConfig pConfig) throws XmlRpcClientException { String userName = pConfig.getBasicUserName(); if (userName != null) { String enc = pConfig.getBasicEncoding(); if (enc == null) { enc = XmlRpcStreamConfig.UTF8_ENCODING; } client.getParams().setParameter(HttpMethodParams.CREDENTIAL_CHARSET, enc); Credentials creds = new UsernamePasswordCredentials(userName, pConfig.getBasicPassword()); AuthScope scope = new AuthScope(null, AuthScope.ANY_PORT, null, AuthScope.ANY_SCHEME); client.getState().setCredentials(scope, creds); client.getParams().setAuthenticationPreemptive(true); } }
protected void setCredentials(XmlRpcHttpClientConfig pConfig) throws XmlRpcClientException { String userName = pConfig.getBasicUserName(); if (userName != null) { String enc = pConfig.getBasicEncoding(); if (enc == null) { enc = XmlRpcStreamConfig.UTF8_ENCODING; } client.getParams().setParameter(HttpMethodParams.CREDENTIAL_CHARSET, enc); Credentials creds = new UsernamePasswordCredentials(userName, pConfig.getBasicPassword()); AuthScope scope = new AuthScope(null, AuthScope.ANY_PORT, null, AuthScope.ANY_SCHEME); client.getState().setCredentials(scope, creds); client.getParams().setAuthenticationPreemptive(true); } }
protected void setCredentials(XmlRpcHttpClientConfig pConfig) throws XmlRpcClientException { String auth; try { auth = HttpUtil.encodeBasicAuthentication(pConfig.getBasicUserName(), pConfig.getBasicPassword(), pConfig.getBasicEncoding()); } catch (UnsupportedEncodingException e) { throw new XmlRpcClientException("Unsupported encoding: " + pConfig.getBasicEncoding(), e); } if (auth != null) { setRequestHeader("Authorization", "Basic " + auth); } }
protected void setCredentials(XmlRpcHttpClientConfig pConfig) throws XmlRpcClientException { String auth; try { auth = HttpUtil.encodeBasicAuthentication(pConfig.getBasicUserName(), pConfig.getBasicPassword(), pConfig.getBasicEncoding()); } catch (UnsupportedEncodingException e) { throw new XmlRpcClientException("Unsupported encoding: " + pConfig.getBasicEncoding(), e); } if (auth != null) { setRequestHeader("Authorization", "Basic " + auth); } }
protected void setCredentials(XmlRpcHttpClientConfig pConfig) throws XmlRpcClientException { String auth; try { auth = HttpUtil.encodeBasicAuthentication(pConfig.getBasicUserName(), pConfig.getBasicPassword(), pConfig.getBasicEncoding()); } catch (UnsupportedEncodingException e) { throw new XmlRpcClientException("Unsupported encoding: " + pConfig.getBasicEncoding(), e); } if (auth != null) { setRequestHeader("Authorization", "Basic " + auth); } }
@Override protected void setCredentials( XmlRpcHttpClientConfig pConfig ) throws XmlRpcClientException { String userName = pConfig.getBasicUserName(); if ( userName != null ) { String enc = pConfig.getBasicEncoding(); if ( enc == null ) { enc = XmlRpcStreamConfig.UTF8_ENCODING; } builder.setRealmPrincipal( userName ).setRealmPassword( pConfig.getBasicPassword() ).setRealmUsePreemptiveAuth( true ).setRealmEnconding( enc ); } }