Java Code Examples for org.apache.http.auth.AuthScope#getHost()

The following examples show how to use org.apache.http.auth.AuthScope#getHost() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HTTPAuthUtil.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
static URI authscopeToURI(AuthScope authScope) throws HTTPException {
  try {
    URI url = new URI("https", null, authScope.getHost(), authScope.getPort(), "", null, null);
    return url;
  } catch (URISyntaxException mue) {
    throw new HTTPException(mue);
  }
}
 
Example 2
Source File: HttpClientHandler.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Override
public Credentials getCredentials(final AuthScope authscope) {
    if (authscope == null) {
        return null;
    }
    final String realm = authscope.getRealm();
    final String host = authscope.getHost();
    final org.apache.ivy.util.Credentials ivyConfiguredCred = CredentialsStore.INSTANCE.getCredentials(realm, host);
    if (ivyConfiguredCred == null) {
        return null;
    }
    return createCredentials(ivyConfiguredCred.getUserName(), ivyConfiguredCred.getPasswd());
}
 
Example 3
Source File: HTTPAuthUtil.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
static public HttpHost authscopeToHost(AuthScope scope) {
  return new HttpHost(scope.getHost(), scope.getPort(), HttpHost.DEFAULT_SCHEME_NAME);
}
 
Example 4
Source File: HTTPFactory.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Deprecated
public static HTTPSession newSession(AuthScope scope) throws HTTPException {
  HttpHost hh = new HttpHost(scope.getHost(), scope.getPort(), HttpHost.DEFAULT_SCHEME_NAME);
  return new HTTPSession(hh);
}