## Velocity Template for login error message production, included by login.vm ## ## authenticationErrorContext - context containing error data, if available ## #if ($authenticationErrorContext && $authenticationErrorContext.getClassifiedErrors().size() > 0 && $authenticationErrorContext.getClassifiedErrors().iterator().next() != "ReselectFlow") ## This handles errors that are classified by the message maps in the authentication config. #set ($eventId = $authenticationErrorContext.getClassifiedErrors().iterator().next()) #set ($eventKey = $springMacroRequestContext.getMessage("$eventId", "login")) #set ($message = $springMacroRequestContext.getMessage("${eventKey}.message", "Login Failure: $eventId")) #elseif ($authenticationErrorContext && $authenticationErrorContext.getExceptions().size() > 0) ## This handles login exceptions that are left unclassified. #set ($loginException = $authenticationErrorContext.getExceptions().get(0)) #if ($loginException.getMessage()) #set ($message = "Login Failure: $loginException.getMessage()") #else #set ($message = $loginException.toString()) #end #end #if ($message)

$encoder.encodeForHTML($message)

#end