org.apache.http.client.fluent.Executor.auth()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(231)

本文整理了Java中org.apache.http.client.fluent.Executor.auth()方法的一些代码示例,展示了Executor.auth()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Executor.auth()方法的具体详情如下:
包路径:org.apache.http.client.fluent.Executor
类名称:Executor
方法名:auth

Executor.auth介绍

暂无

代码示例

代码示例来源:origin: jooby-project/jooby

private Executor executor() {
 if (executor == null) {
  if (this.host.startsWith("https://")) {
   Try.run(() -> {
    SSLContext sslContext = SSLContexts.custom()
      .loadTrustMaterial(null, (chain, authType) -> true)
      .build();
    builder.setSSLContext(sslContext);
    builder.setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE);
   }).throwException();
  }
  client = builder.build();
  executor = Executor.newInstance(client);
  if (creds != null) {
   executor.auth(creds);
  }
 }
 return executor;
}

代码示例来源:origin: org.apache.sling/org.apache.sling.distribution.core

private Executor buildAuthExecutor(String username, String password) {
  URI uri = distributionEndpoint.getUri();
  Executor executor = Executor.newInstance()
      .auth(new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()), username, password)
      .authPreemptive(new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()));
  log.debug("authenticate user={}, endpoint={}", username, uri);
  return executor;
}

代码示例来源:origin: org.apache.httpcomponents/fluent-hc

public Executor auth(final Credentials cred) {
  return auth(AuthScope.ANY, cred);
}

代码示例来源:origin: Adobe-Consulting-Services/acs-aem-commons

if (username != null && password != null) {
  HttpHost httpHost = new HttpHost(hostname, port, useSSL ? "https" : "http");
  executor.auth(httpHost, username, password).authPreemptive(httpHost);

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public Executor auth(final Credentials cred) {
  return auth(AuthScope.ANY, cred);
}

代码示例来源:origin: com.adobe.acs/acs-aem-commons-bundle

if (username != null && password != null) {
  HttpHost httpHost = new HttpHost(hostname, port, useSSL ? "https" : "http");
  executor.auth(httpHost, username, password).authPreemptive(httpHost);

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public Executor auth(final HttpHost host,
    final String username, final String password) {
  return auth(host, new UsernamePasswordCredentials(username, password));
}

代码示例来源:origin: org.apache.httpcomponents/fluent-hc

public Executor auth(final HttpHost host,
    final String username, final String password) {
  return auth(host, new UsernamePasswordCredentials(username, password));
}

代码示例来源:origin: org.apache.httpcomponents/fluent-hc

public Executor auth(final String username, final String password) {
  return auth(new UsernamePasswordCredentials(username, password));
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public Executor auth(final String username, final String password) {
  return auth(new UsernamePasswordCredentials(username, password));
}

代码示例来源:origin: org.apache.httpcomponents/fluent-hc

public Executor auth(final HttpHost host, final Credentials creds) {
  final AuthScope authScope = host != null ?
      new AuthScope(host.getHostName(), host.getPort()) : AuthScope.ANY;
  return auth(authScope, creds);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public Executor auth(final HttpHost host, final Credentials creds) {
  final AuthScope authScope = host != null ?
      new AuthScope(host.getHostName(), host.getPort()) : AuthScope.ANY;
  return auth(authScope, creds);
}

代码示例来源:origin: org.apache.httpcomponents/fluent-hc

/**
 * @since 4.4
 */
public Executor auth(final String host, final Credentials creds) {
  return auth(HttpHost.create(host), creds);
}

代码示例来源:origin: org.apache.httpcomponents/fluent-hc

public Executor auth(final HttpHost host,
    final String username, final String password,
    final String workstation, final String domain) {
  return auth(host, new NTCredentials(username, password, workstation, domain));
}

代码示例来源:origin: org.apache.httpcomponents/fluent-hc

public Executor auth(final String username, final String password,
    final String workstation, final String domain) {
  return auth(new NTCredentials(username, password, workstation, domain));
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public Executor auth(final HttpHost host,
    final String username, final String password,
    final String workstation, final String domain) {
  return auth(host, new NTCredentials(username, password, workstation, domain));
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public Executor auth(final String username, final String password,
    final String workstation, final String domain) {
  return auth(new NTCredentials(username, password, workstation, domain));
}

相关文章