Tabnine Logo
AuthenticatorUtils.computeBasicAuthentication
Code IndexAdd Tabnine to your IDE (free)

How to use
computeBasicAuthentication
method
in
org.asynchttpclient.util.AuthenticatorUtils

Best Java code snippets using org.asynchttpclient.util.AuthenticatorUtils.computeBasicAuthentication (Showing top 7 results out of 315)

origin: AsyncHttpClient/async-http-client

private static String computeBasicAuthentication(Realm realm) {
 return realm != null ? computeBasicAuthentication(realm.getPrincipal(), realm.getPassword(), realm.getCharset()) : null;
}
origin: AsyncHttpClient/async-http-client

 authorizationHeader = computeBasicAuthentication(realm);
 break;
case DIGEST:
origin: AsyncHttpClient/async-http-client

public static String perRequestProxyAuthorizationHeader(Request request, Realm proxyRealm) {
 String proxyAuthorization = null;
 if (proxyRealm != null && proxyRealm.isUsePreemptiveAuth()) {
  switch (proxyRealm.getScheme()) {
   case BASIC:
    proxyAuthorization = computeBasicAuthentication(proxyRealm);
    break;
   case DIGEST:
    if (isNonEmpty(proxyRealm.getNonce())) {
     // update realm with request information
     proxyRealm = realm(proxyRealm)
         .setUri(request.getUri())
         .setMethodName(request.getMethod())
         .build();
     proxyAuthorization = computeDigestAuthentication(proxyRealm);
    }
    break;
   case NTLM:
   case KERBEROS:
   case SPNEGO:
    // NTLM, KERBEROS and SPNEGO are only set on the first request with a connection,
    // see perConnectionProxyAuthorizationHeader
    break;
   default:
    throw new IllegalStateException("Invalid Authentication scheme " + proxyRealm.getScheme());
  }
 }
 return proxyAuthorization;
}
origin: org.asynchttpclient/async-http-client-api

public static String computeBasicAuthentication(ProxyServer proxyServer) {
  return computeBasicAuthentication(proxyServer.getPrincipal(), proxyServer.getPassword(), proxyServer.getCharset());
}
origin: org.asynchttpclient/async-http-client-api

public static String computeBasicAuthentication(Realm realm) {
  return computeBasicAuthentication(realm.getPrincipal(), realm.getPassword(), realm.getCharset());
}
origin: org.asynchttpclient/async-http-client-api

public static String perRequestProxyAuthorizationHeader(Request request, ProxyServer proxyServer, Realm realm, boolean connect) {
  String proxyAuthorization = null;
  if (!connect && proxyServer != null && proxyServer.getScheme() == AuthScheme.BASIC) {
    proxyAuthorization = computeBasicAuthentication(proxyServer);
  } else if (realm != null && realm.getUsePreemptiveAuth() && realm.isTargetProxy()) {
    switch (realm.getScheme()) {
    case BASIC:
      proxyAuthorization = computeBasicAuthentication(realm);
      break;
    case DIGEST:
      if (isNonEmpty(realm.getNonce()))
        proxyAuthorization = computeDigestAuthentication(realm);
      break;
    case NTLM:
    case KERBEROS:
    case SPNEGO:
      // NTLM, KERBEROS and SPNEGO are only set on the first request,
      // see firstRequestOnlyAuthorizationHeader
    case NONE:
      break;
    default:
      throw new IllegalStateException("Invalid Authentication " + realm);
    }
  }
  return proxyAuthorization;
}
origin: org.asynchttpclient/async-http-client-api

  public static String perRequestAuthorizationHeader(Request request, Realm realm) {

    String authorizationHeader = null;

    if (realm != null && realm.getUsePreemptiveAuth()) {

      switch (realm.getScheme()) {
      case BASIC:
        authorizationHeader = computeBasicAuthentication(realm);
        break;
      case DIGEST:
        if (isNonEmpty(realm.getNonce()))
          authorizationHeader = computeDigestAuthentication(realm);
        break;
      case NTLM:
      case KERBEROS:
      case SPNEGO:
        // NTLM, KERBEROS and SPNEGO are only set on the first request,
        // see firstRequestOnlyAuthorizationHeader
      case NONE:
        break;
      default:
        throw new IllegalStateException("Invalid Authentication " + realm);
      }
    }

    return authorizationHeader;
  }
}
org.asynchttpclient.utilAuthenticatorUtilscomputeBasicAuthentication

Popular methods of AuthenticatorUtils

  • perConnectionAuthorizationHeader
  • perConnectionProxyAuthorizationHeader
  • perRequestAuthorizationHeader
  • perRequestProxyAuthorizationHeader
  • append
  • computeDigestAuthentication
  • computeRealmURI
  • getHeaderWithPrefix
  • getProxyAuthorizationHeader

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • String (java.lang)
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now