congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AuthenticatorUtils.computeRealmURI
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: AsyncHttpClient/async-http-client

private void newResponse(MessageDigest md) {
 // when using preemptive auth, the request uri is missing
 if (uri != null) {
  // BEWARE: compute first as it uses the cached StringBuilder
  String digestUri = AuthenticatorUtils.computeRealmURI(uri, useAbsoluteURI, omitQuery);
  StringBuilder sb = StringBuilderPool.DEFAULT.stringBuilder();
  // WARNING: DON'T MOVE, BUFFER IS RECYCLED!!!!
  byte[] ha1 = ha1(sb, md);
  byte[] ha2 = ha2(sb, digestUri, md);
  appendBase16(sb, ha1);
  appendMiddlePart(sb);
  appendBase16(sb, ha2);
  byte[] responseDigest = md5FromRecycledStringBuilder(sb, md);
  response = toHexString(responseDigest);
 }
}
origin: AsyncHttpClient/async-http-client

private static String computeDigestAuthentication(Realm realm) {
 String realmUri = computeRealmURI(realm.getUri(), realm.isUseAbsoluteURI(), realm.isOmitQuery());
 StringBuilder builder = new StringBuilder().append("Digest ");
 append(builder, "username", realm.getPrincipal(), true);
 append(builder, "realm", realm.getRealmName(), true);
 append(builder, "nonce", realm.getNonce(), true);
 append(builder, "uri", realmUri, true);
 if (isNonEmpty(realm.getAlgorithm()))
  append(builder, "algorithm", realm.getAlgorithm(), false);
 append(builder, "response", realm.getResponse(), true);
 if (realm.getOpaque() != null)
  append(builder, "opaque", realm.getOpaque(), true);
 if (realm.getQop() != null) {
  append(builder, "qop", realm.getQop(), false);
  // nc and cnonce only sent if server sent qop
  append(builder, "nc", realm.getNc(), false);
  append(builder, "cnonce", realm.getCnonce(), true);
 }
 builder.setLength(builder.length() - 2); // remove tailing ", "
 // FIXME isn't there a more efficient way?
 return new String(StringUtils.charSequence2Bytes(builder, ISO_8859_1));
}
origin: org.asynchttpclient/async-http-client-api

public static String computeRealmURI(Realm realm) {
  return computeRealmURI(realm.getUri(), realm.isUseAbsoluteURI(), realm.isOmitQuery());
}
origin: org.asynchttpclient/async-http-client-api

private void newResponse(MessageDigest md) {
  // BEWARE: compute first as it used the cached StringBuilder
  String digestUri = AuthenticatorUtils.computeRealmURI(uri, useAbsoluteURI, omitQuery);
  
  StringBuilder sb = StringUtils.stringBuilder();
  
  // WARNING: DON'T MOVE, BUFFER IS RECYCLED!!!!
  byte[] secretDigest = secretDigest(sb, md);
  byte[] dataDigest = dataDigest(sb, digestUri, md);
  
  appendBase16(sb, secretDigest);
  appendDataBase(sb);
  appendBase16(sb, dataDigest);
  
  byte[] responseDigest = md5FromRecycledStringBuilder(sb, md);
  response = toHexString(responseDigest);
}
origin: org.asynchttpclient/async-http-client-api

private static String computeDigestAuthentication(Realm realm) {
  StringBuilder builder = new StringBuilder().append("Digest ");
  append(builder, "username", realm.getPrincipal(), true);
  append(builder, "realm", realm.getRealmName(), true);
  append(builder, "nonce", realm.getNonce(), true);
  append(builder, "uri", computeRealmURI(realm), true);
  if (isNonEmpty(realm.getAlgorithm()))
    append(builder, "algorithm", realm.getAlgorithm(), false);
  append(builder, "response", realm.getResponse(), true);
  if (realm.getOpaque() != null)
    append(builder, "opaque", realm.getOpaque(), true);
  if (realm.getQop() != null) {
    append(builder, "qop", realm.getQop(), false);
    // nc and cnonce only sent if server sent qop
    append(builder, "nc", realm.getNc(), false);
    append(builder, "cnonce", realm.getCnonce(), true);
  }
  builder.setLength(builder.length() - 2); // remove tailing ", "
  // FIXME isn't there a more efficient way?
  return new String(StringUtils.charSequence2Bytes(builder, ISO_8859_1));
}
org.asynchttpclient.utilAuthenticatorUtilscomputeRealmURI

Popular methods of AuthenticatorUtils

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

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • From CI to AI: The AI layer in your organization
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