Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space IDS and version 8.2

...


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
languagetextthemeRDark
titleListing 8. Rejecting un-solicited Response messages
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
languagetext
themeRDark
titleListing 9. Overriding the authnRequest method
@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
languagetext
themeRDark
titleListing 10. Implementing an LoginEventListener and overriding the login method
@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
languagetextthemeRDark
titleListing 11. Implementing an AuthnRequestEventListener and overriding the authnRequest method
@Override
public void authnRequest(AuthnRequestEvent e) {
	e.getAuthnRequest().setTemplate("template2");
} 

...