Nuxeo Server

How to Override the Login Page

Updated: December 5, 2017 Page Information Edit on GitHub

This page is scheduled for review and update. Check back soon for updated content!

Login Page

The Login Page when the server is deployed is located at <nuxeo_server>/nxserver/nuxeo.war/login.jsp. In the source code, this page is located at nuxeo-platform-webapp/src/main/resources/nuxeo.war/login.jsp.

The easiest way to override it is to create a new JSP page with the exact same name and put it in at the root of the directory nuxeo.war of your bundle.

You will find more information related to the authentication here: Authentication.

An helper class will help you to access configuration for the login page, like the image to display on the background for example. The class is org.nuxeo.ecm.platform.ui.web.auth.LoginScreenHelper.

Here is an example getting few configuration data:

login.jsp

<%@ page import="org.nuxeo.ecm.platform.ui.web.auth.LoginScreenHelper"%>
<%
LoginScreenConfig screenConfig = LoginScreenHelper.getConfig();
// fetch Login Screen config and manage default
boolean showNews = screenConfig.getDisplayNews();
String iframeUrl = screenConfig.getNewsIframeUrl();
String bodyBackgroundStyle = LoginScreenHelper.getValueWithDefault(screenConfig.getBodyBackgroundStyle(), "url('" + context + "/img/login_bg.jpg') no-repeat center center fixed #333");
String headerStyle = LoginScreenHelper.getValueWithDefault(screenConfig.getHeaderStyle(), "");
String loginBoxBackgroundStyle = LoginScreenHelper.getValueWithDefault(screenConfig.getLoginBoxBackgroundStyle(), "none repeat scroll 0 0 #fff");
String footerStyle = LoginScreenHelper.getValueWithDefault(screenConfig.getFooterStyle(), "");
boolean disableBackgroundSizeCover = Boolean.TRUE.equals(screenConfig.getDisableBackgroundSizeCover());
String logoWidth = LoginScreenHelper.getValueWithDefault(screenConfig.getLogoWidth(), "113");
String logoHeight = LoginScreenHelper.getValueWithDefault(screenConfig.getLogoHeight(), "20");
String logoAlt = LoginScreenHelper.getValueWithDefault(screenConfig.getLogoAlt(), "Nuxeo");
String logoUrl = LoginScreenHelper.getValueWithDefault(screenConfig.getLogoUrl(), context + "/img/nuxeo_logo.png");
%>

Deployment

In order to be sure that your JSP page will override the default one, a modification must be added in the deployment-fragment.xml file of your bundle. In Nuxeo Platform, the module containing the login page is nuxeo-platform-webapp.

We want our bundle to be loaded after this module because our custom login page will override the default login page. To achieve this, add the following requirement in the deployment-fragment.xml, at the top of the file, just after the <fragment> tag.

<require>org.nuxeo.ecm.platform.web.common</require>

 


5 days ago Manon Lumeau add tags for doc days
a month ago manonlumeau Added content-review-lts2017 label
2 months ago manonlumeau NXDOC-1346-FT review screenshot
a year ago Solen Guitter 11
a year ago Solen Guitter 10 | Update how-to topics
2 years ago Manon Lumeau 9
2 years ago Arnaud Kervern 8
3 years ago Manon Lumeau 7
3 years ago Manon Lumeau 6
3 years ago Solen Guitter 5
3 years ago Gildas Lefevre 4
3 years ago Gildas Lefevre 3
3 years ago Gildas Lefevre 2 | NXDOC-363: How to override the login page
3 years ago Gildas Lefevre 1
History: Created by Gildas Lefevre