Class AuthLib

java.lang.Object
org.apache.jena.http.auth.AuthLib

public class AuthLib extends Object
  • Constructor Details

    • AuthLib

      public AuthLib()
  • Method Details

    • authExecute

      public static <T> java.net.http.HttpResponse<T> authExecute(java.net.http.HttpClient httpClient, java.net.http.HttpRequest httpRequest, java.net.http.HttpResponse.BodyHandler<T> bodyHandler)
      Call HttpClient.send(java.net.http.HttpRequest, java.net.http.HttpResponse.BodyHandler<T>) after applying an active AuthRequestModifier to modify the HttpRequest.Builder. If no AuthRequestModifier is available and if a 401 response is received, setup a AuthRequestModifier passed on registered username and password information. This function supports basic and digest authentication.
      Parameters:
      httpClient - HttpClient
      httpRequest -
      bodyHandler -
      Returns:
      HttpResponse
    • authenticator

      public static Authenticator authenticator(String user, String password)
      Create a JDK Authenticator for this (username and password). The java.net.http as supplied only supports basic authentication.
    • getPasswordAuthentication

      public static PasswordAuthentication getPasswordAuthentication(Authenticator authenticator)