This topic describes how to create and deploy a custom login page on LabKey Server. A custom login page can incorporate custom text or images, enhancing the branding of your server or providing site-specific guidance to your users.

Module Structure for Login Page

A custom login page is defined as a view in the module of your choice. Learn more about module structures here: Map of Module Files. Note that there will be other files and folders in the module that are not shown in this illustration.

MODULE_NAME  └──resources       └──views            LOGIN_PAGE_NAME.html

For example, if you were using a module named "myModule" and your page was named "myLoginPage.html" the relative path would be:


Create Custom Login Page

By default, LabKey Server uses the login page found in the server source at /server/modules/core/resources/views/login.html.

Use the standard login page as a template for your custom page.

  • Copy the template HTML file into your module (at MODULE_NAME/resources/views/LOGIN_PAGE_NAME.html)
  • Modify it according to your requirements.

Note that the standard login page works in conjunction with:

The login.js file provides access to the Java actions that handle user authentication, such as loginApi.api and acceptTermsOfUseApi.api. Your login page should retain the use of these actions.

Enable Custom Login Page

Build and deploy your module and restart your server so that it will recognize the new page resource. Once you have deployed your custom login page, you will need to tell the server to use it instead of the standard login page. Note that you must have "AdminOperationsPermission" to update this setting.

  • Select (Admin) > Site > Admin Console.
  • Under Configuration, click Look and Feel Settings.
  • Enter the Alternative login page using the format "MODULE_NAME-LOGIN_PAGE_NAME". You do not include the full path or file extension. In our example, this would be:
  • Click Save.

For details see Look and Feel Settings.

Related Topics


Was this content helpful?

Log in or register an account to provide feedback

expand all collapse all