...
The example code above also shows a defined listener-class value. See 4511727759 Event Handlers.
Network Address Tolerance
...
If the application wants to control receiving of SAML un-solicited Response messages then an event handler for the receivedResponse event needs to be implemented.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public void receivedResponse(ResponseEvent event) throws MessageRejectedException { if(event.getInResponseTo() == null) { throw new MessageRejectedException("Unsolicited response rejected"); } } |
...
The UAS SSO login screen locale can be set by implementing an AuthnRequestEventListener and overriding the authnRequest method:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
@Override public void authnRequest(AuthnRequestEvent event) { String locale = "en"; event.getAuthnRequest().setLocale(locale); } |
...
It is possible to change the default language during the login sequence. Application can receive the latest locale selected during UAS SSO login by implementing an LoginEventListener and overriding the login() –method:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
@Override public void login(LoginEvent event) { HttpServletRequest rq = event.getHttpRequest(); HttpSession session = rq.getSession(); String locale = rq.getParameter("locale"); if(null == locale) { locale = "en"; } session.setAttribute("locale", locale); } |
...
The template specified in the authentication request message can be set by implementing AuthnRequestEventListener and overriding the authnRequest() –method.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
@Override public void authnRequest(AuthnRequestEvent e) { e.getAuthnRequest().setTemplate("template2"); } |
...