Customizing WSO2 Identity Server UIs¶
From WSO2 Identity Server 5.9.0 onwards, a new UI extension has been introduced to easily customize the basic user interfaces like login page, username and password recovery pages, and single sign-on pages.
All these UIs are available in the authenticationendpoint
and accountrecoveryendpoint
web apps that are located in the <IS-Home>/repository/deployment/server/webapps
folder. To customize these pages, follow the steps below.
Step 1: Create the extensions folder¶
-
Navigate to the
<IS-Home>/repository/deployment/server/webapps/authenticationendpoint
folder and create a new folder calledextensions
.Info
You will be adding the customized JSP files along with the custom CSS files into this new
extensions
folder. -
Similarly, navigate to the
<IS-Home>/repository/deployment/server/webapps/accountrecoveryendpoint
folder and create anextensions
folder.
Step 2: Copy the existing header and footer content¶
In order to customize the header and footer content of the web applications, first you need to copy them to the newly cerated extensions
folders.
-
To copy the header and footer content of the authenticationendpoint web application:
-
Navigate to the
<IS-Home>/repository/deployment/server/webapps/authenticationendpoint/includes
folder. -
Copy the
header.jsp
andfooter.jsp
files into the<IS-Home>/repository/deployment/server/webapps/authenticationendpoint/extensions
folder.Note
The
header.jsp
andfooter.jsp
files have the capability to override the corresponding files in theincludes
folder.
-
-
Similarly, copy the header and footer content of the accountrecoveryendpoint web application.
Step 3: Create styling¶
Create the basic CSS styles that are required to override the existing UI styling.
<style type="text/css">
body {
background: #1e1e2f;
color: #ffffff;
}
.logo-container {
padding: 15px 30px;
}
header .brand img.logo {
height: 40px;
}
.wr-title {
background: #32344e !important;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.header {
border-top: 3px solid #1e8cf8;
background: #1e1e2f;
min-height: 70px;
border-bottom: 1px solid #31314b;
}
.....
a:hover,
a:active {
color: #3a9dff;
}
</style>
Step 4: Edit the existing header and footer content¶
To add footer.jsp and header.jsp in extensions folder as follows:
-
To edit the header content of the authenticationendpoint web application:
-
Open the
header.jsp
file in the/repository/deployment/server/webapps/authenticationendpoint/extensions` folder. -
Add the following includes:
<%@include file=”../localize.jsp” %> <%@include file=”../init-url.jsp” %>
- Add the styles that you created in Step 3 inside the header tag as shown in the sample file.
-
-
To edit the footer content of the authenticationendpoint web application:
-
Open the
footer.jsp
file in the/repository/deployment/server/webapps/authenticationendpoint/extensions` folder. -
Add the company name as shown in the sample file.
-
-
Similarly, you can customize the accountrecovery web application header and footer.
Note
Make sure to add the following include to the top, when editing the
header.jsp
file of the accountrecovery web application.<%@include file=”../localize.jsp” %>
-
Refresh the browser and check out the customized header and footer content.
Tip
Restarting the server is NOT required to reflect the changes—browser refresh will display the changes.
Customized Login Page
Customized Recover Username page
Customized Recover Password page
Customized Self signup page
Note
One advantage of this approach is that WUM updates will not affect your UI changes and you need not worry about manually adding your custom changes.