Class BasicAuthenticationHelper

java.lang.Object
com.atlassian.crowd.plugin.rest.filter.BasicAuthenticationHelper

public final class BasicAuthenticationHelper extends Object
A collection of methods that help implementing HTTP basic auth for end users and applications.
  • Method Details

    • getBasicAuthCredentials

      public static BasicAuthenticationHelper.Credentials getBasicAuthCredentials(javax.servlet.http.HttpServletRequest request)
      Returns the Basic Auth credentials.
      Parameters:
      request - the request
      Returns:
      basic authentication credentials
    • respondWithChallenge

      public static void respondWithChallenge(javax.servlet.http.HttpServletResponse response, String message, String basicAuthRealm) throws IOException
      Responds to request with a message and a Basic Authentication challenge.
      Parameters:
      response - the HTTP response
      message - plain text message to send
      basicAuthRealm - used as the realm for the WWWW-Authenticate header
      Throws:
      IOException