Class GrouperUiFormLogin

java.lang.Object
edu.internet2.middleware.grouper.ui.GrouperUiFormLogin

public class GrouperUiFormLogin extends Object
Simple form-based login for the Grouper UI, as a DEVELOPMENT convenience (for example so an automated/headless browser can log in without a native HTTP BASIC popup, which such browsers cannot drive).

This is wired dynamically inside GrouperUiFilter (which is itself registered programmatically in CommonServletContainerInitializer), NOT via a web.xml login-config -- the Servlet API does not allow setting an auth-method at runtime, so container FORM auth is not an option here.

It is gated two ways and BOTH must hold:

  • config: grouper.is.ui.formAuthn = true (in grouper.hibernate.properties)
  • environment: NOT production (see isProductionEnvironment())

Credentials are checked by the same Authentication path used for the BASIC auth mode, so the grouperPasswordConfigOverride_UI_<user>_pass entries (and the grouper_password table) are what accept a login.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    handleFormLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session)
    Handle the form login for a request that is not yet authenticated.
    static boolean
    true if this looks like a production environment, in which case form login must never run.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GrouperUiFormLogin

      public GrouperUiFormLogin()
  • Method Details

    • isProductionEnvironment

      public static boolean isProductionEnvironment()
      true if this looks like a production environment, in which case form login must never run. Mirrors the logic used for the environment banner (IndexContainer): production when grouper.env.name is blank, prod, or production.
      Returns:
      true if production
    • handleFormLogin

      public static boolean handleFormLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session) throws IOException
      Handle the form login for a request that is not yet authenticated.
      Parameters:
      request - the request
      response - the response
      session - the http session
      Returns:
      true if the user is authenticated and the filter chain should continue; false if this method has already written the response (the login form or a post-login redirect) and the caller should return immediately.
      Throws:
      IOException - on write error