Hard Coding the Domain on the Login Page

In many instances it may be desirable to have a hard coded domain value in your login page.  With the value hard coded, users are automatically set to login to the specified domain.  The following are steps to accomplish this behavior:

  1. In enPortal, click the domain and select the Login Pages tab to see what System Login Page is selected.

  2. Go to the appropriate login.jsp and edit the file (in this example, it would be INSTALL_HOME/server/webapps/enportal/login_pages/login.jsp).
  3. Find <input type="text" name="domainSelect" value='<%=domain%>'
  4. Change to <input type="text" name="domainSelect" value=’Test’ (substitute Test with your desired domain).
  5. Apply “style=’display: none;’” in both the label and input field to hide the display of domain information.

After doing this, restart the server and the next time you access the login page you will no longer see the domain input field or label (you may need to clear browser cache).  However, this will make logging in as the administrator user more difficult.  A few options to work around that are: 

  • Remove Step 5 from the steps above.  This way the Domain input box will be visible and automatically set to Test on the login page, but will allow you to edit that to System when you need to log in as administrator.
  • Place a hidden element on the login page that you can click to enter the domain field.
  • Add something to the login page code that sets the Domain to "System" if the user name is "administrator".
  • 65
  • 10-Mar-2017