Show different UI texts depending on the template used

It is possible to show different UI text depending on the template requested by the application - either the template specified in the Agent's template field or for mobile connect.

Step-by-step guide Example 1

The same application could show very different template and user interface text, depending on the template name listed in the Template Names field of Ubilogin Management. By default, the first tempalte name listed will be used.

  1. Modify messages.properties

    # Christmas messages
    christmas = christmas.properties
    errors/christmas = christmas_errors.properties
    christmas_sv = christmas_sv.properties
    errors/christmas_sv = christmas_errors_sv.properties
    
    # internal messages
    internal = internal.properties
    errors/internal = internal_errors.properties
    internal_sv = internal_sv.properties
    errors/internal_sv = internal_errors_sv.properties
    
    # external messages
    external = external.properties
    errors/external = external_errors.properties
    external_sv = external_sv.properties
    errors/external_sv = external_errors_sv.properties
    
    
  2. Modify custom/messages/christmas.properties to contain text in default language

    HEADER_TEXT1 = Merry Christmas!
    HEADER_TEXT2 = Have a happy and properous new year!
    PASSWORD_INTRO_TITLE = Ho Ho Ho!
  3. Modify custom/messages/christmas_sv.properties to contain text in Swedish language

    HEADER_TEXT1 = God Jul!
    HEADER_TEXT2 = Gott nytt år!
    PASSWORD_INTRO_TITLE = Ho Ho Ho!
  4. Modify custom/messages/christmas_errors.properties to contain error text in default language

    USER_NOT_FOUND = Santa cannot find you on his list. Have you been naughty?
    ACCOUNT_EXPIRED = Are you too old for this?
  5. Modify custom/messages/christmas_errors_sv.properties to contain error text in Swedish language

    USER_NOT_FOUND = Santa kan inte hitta dig på sin lista. Har du varit stygg?
    ACCOUNT_EXPIRED = Är du för gammal för detta?
  6. An integrated application can set the template dynamically using the appropriate API. For Ubisecure SAML SP for Java, the template is set in the AuthnRequestEvent using the setTemplate method.

    @Override
    public void authnRequest(AuthnRequestEvent e) {
        e.getAuthnRequest().setTemplate("christmas");
    }


 

The name of the tempate chosen currently is visible at the /uas/info page if enabled.

The name of the tempate chosen currently is visible in the view() array in the source code of the login or error screens generated by Ubisecure SSO.