9.5.1. Customization of IDP

IDP Login Form

The login form files are located in the idp folder of your web application. In case of deployment to Tomcat it is the tomcat/webapps/app/idp folder. You can replace the standard files by creating files with the same name in the web/idp folder of your project’s web module.

By default, the IDP login form uses a localization mechanism based on the webL10n JavaScript library and contains messages for English and Russian locales. In order to create messages for other languages, create file modules/web/web/idp/l10n/locales.ini and define the list of message files in it:

[*]
@import url(messages.properties)

[ru]
@import url(messages_ru.properties)

[es]
@import url(messages_es.properties)

Additional message files must be located in the same folder (modules/web/web/idp/l10n). As a template for your message files, use the corresponding files from the cuba-idp module which is available as a dependency JAR in your project.

You can also completely replace the login form by creating your own login.html and js/login.js files, or modify the styles in the css/login.css file.

IDP Implementation

IDP entry points are implemented in the cuba_IdpController and cuba_IdpServiceController Spring MVC controllers. You can create your own controllers and define them in the idp-dispatcher-spring.xml file of your web module with the same names to provide a customized behaviour.

In the standard implementation, the IDP sessions are stored on Middleware and replicated in cluster. This functionality is provided by the cuba_IdpSessionStore bean. You can customize the sessions storage by creating a bean with the same name in the core module of your project and registering it in the corresponding spring.xml file. See details in the Extending Business Logic section.