java.lang.Object
org.apache.jena.fuseki.main.auth.SimpleBearer

public class SimpleBearer extends Object
Support for bearer authentication token of the form Bearer: base64("user:NAME"). This is unsafe if believed without further checking but for tests and development it provides a mode whereby the deployment authentication machinery isn't needed. ,p> Usage:
     new AuthBearerFilter(SimpleBearer::getUserFromToken64);
 
  • Field Details

    • USER_PREFIX

      public static String USER_PREFIX
  • Constructor Details

    • SimpleBearer

      public SimpleBearer()
  • Method Details

    • requestAuthorizationToken

      public static String requestAuthorizationToken(String user)
      Create the header string setting for bearer auth in the "user:" scheme. The result is for the form "base64chars".
    • requestAuthorizationHeader

      public static String requestAuthorizationHeader(String user)
      Create the header string setting for bearer auth in the "user:" scheme. The result is for the form "Bearer base64chars".
    • getUserFromAuthHeader

      public static String getUserFromAuthHeader(String headerValue)
      Get the user name from a "user:" bearer token which not in base64 encoded plain text.
      See Also:
    • getUserFromToken64

      public static String getUserFromToken64(String b64token)
      Decode a base64 string and get the user name assuming the "user:" form.