title: JBoss JAAS custom Login Module Error messages
body: <p>I have an application that makes used of a <a href="https://stackoverflow.com/questions/6692546/jboss-jaas-custom-login-module">custom login module</a> of JBoss. Authentication can fail for a wide variety of reasons and i have to display these to the user instead of the usual <code>Inavlid username / password</code> error. </p>
  
  <p>Is there a way to get error message from the login message? I think the best would be to through an exception since authenticate returns a boolean, however i can't figure how to catch it after authentication. Any pointers welcomes.</p>