Class MCRLoginServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.mycore.frontend.servlets.MCRServlet
org.mycore.user2.login.MCRLoginServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class MCRLoginServlet extends MCRServlet
Provides functionality to select login method, change login user and show a welcome page. Login methods and realms are configured in realms.xml. The login form for local users is login.xml.
Author:
Frank Lützenkirchen, Thomas Scheffler (yagee)
See Also:
  • Field Details

    • REALM_URL_PARAMETER

      protected static final String REALM_URL_PARAMETER
      See Also:
    • LOCAL_LOGIN_SECURE_ONLY

      protected static final boolean LOCAL_LOGIN_SECURE_ONLY
  • Constructor Details

    • MCRLoginServlet

      public MCRLoginServlet()
  • Method Details

    • init

      public void init() throws jakarta.servlet.ServletException
      Overrides:
      init in class MCRServlet
      Throws:
      jakarta.servlet.ServletException
    • doGetPost

      public void doGetPost(MCRServletJob job) throws Exception
      MCRLoginServlet handles four actions: MCRLoginServlet?url=foo stores foo as redirect url and displays a list of login method options. MCRLoginServlet?url=foo&realm=ID stores foo as redirect url and redirects to the login URL of the given realm. MCRLoginServlet?action=login checks input from editor login form and changes the current login user and redirects to the stored url. MCRLoginServlet?action=cancel does not change login user, just redirects to the target url
      Overrides:
      doGetPost in class MCRServlet
      Throws:
      Exception
    • getReturnURL

      protected static String getReturnURL(jakarta.servlet.http.HttpServletRequest req)
    • presentLoginForm

      protected void presentLoginForm(MCRServletJob job) throws IOException, TransformerException, SAXException, jakarta.xml.bind.JAXBException
      Throws:
      IOException
      TransformerException
      SAXException
      jakarta.xml.bind.JAXBException
    • addFormFields

      protected static void addFormFields(MCRLogin login, String loginToRealm)