Customize Web pages
All web pages are xhtml files.
Default pages bundled in the jans-auth.war
are:#
- Login page: login.xhtml
- Authorization page: authorize.xhtml
- Logout page: logout.xhtml
- Error page: error.xhtml
To override default pages listed above:#
Put a modified login.xhtml
or authorize.xhtml
or error.xhtml
or logout.xhtml
under /opt/gluu/jetty/jans-auth/custom/pages/
Directory structure for customization#
/opt/jans/jetty/jans-auth/
|-- custom
| |-- i18n (resource bundles)
| |-- libs (library files used by custom script)
| |-- pages (web pages)
| |-- static (images and css files)
Adding a new web page for Person Authentication scripts#
- If
enterOTP.xhtml
is your webpage for step 2 of authentication, place under/opt/jans/jetty/jans-auth/custom/pages/enterOTP.xhtml
- Reference it in the custom script as follows:
def getPageForStep(self, configurationAttributes, step): # Used to specify the page you want to return for a given step if (step == 1): return "/auth/login.xhtml" if (step == 2) return "/auth/enterOTP.xhtml"
Customized resource bundles:#
-
Resource bundles that are present in the jans-auth.war are present in this folder
-
To override the defaults, custom
.properties
files should be placed in the following file under this path :/opt/jans/jetty/jans-auth/custom/i18n/jans-auth.properties
Resource bundle names to support other languages should be placed under the same folder/opt/jans/jetty/jans-auth/custom/i18n/
. Some examples of file names are :- jans-auth_en.properties
- jans-auth_bg.properties
- jans-auth_de.properties
- jans-auth_es.properties
- jans-auth_fr.properties
- jans-auth_it.properties
- jans-auth_ru.properties
- jans-auth_tr.properties
-
To add translation for a language that is not yet supported, create new properties file in resource folder and name it jans-auth_[language_code].properties, then add language code as supported-locale to the faces-config.xml present in the same folder.
Custom CSS files:#
- Place the file in
/opt/gluu/jetty/jans-auth/custom/static/stylesheet/theme.css
- Reference it in .xhtml file using the URL
https://your.jans.server/jans-auth/ext/resources/stylesheet/theme.css
or/jans-auth/ext/resources/stylesheet/theme.css
Custom image files:#
- All images should be placed under
/opt/gluu/jetty/jans-auth/custom/static/img
- Reference it in .xhtml file using the URL
https://your.jans.server/oxauth/ext/resources/img/fileName.png
or/oxauth/ext/resources/img/fileName.jpg