1 Reply Latest reply on Jul 22, 2013 5:41 AM by mposolda

    Gatein Portal login - Display custom error message

    deepak.sambrani

      Is it possible to display custom error meggase during Gatein Portal login? Like if I enter wrong password  OR wrong user OR user has already looged on in a session, the same generic message is displayed like "Sign in failed - wrong username or password" Can we have different error messages in these scenario's via configuration or any other means?

        • 1. Re: Gatein Portal login - Display custom error message
          mposolda

          Actually it's not possible. I think we could send some context/error reason from JAAS login through session attribute and read it from LoginServlet/login.jsp and display the actual reason. Could you create JIRA in https://issues.jboss.org/browse/GTNPORTAL ?

           

          I guess that you want to display custom message if user is already logged in different session. To achieve it, you will need to:

          - Create subclass of JBossLoginModule (or TomcatLoginModule) and override method "commit()" which will set some error flag as attribute into Http session in case that singleLogin=true and user is already logged in IdentityRegistry . You can look at existing login modules (SSOLoginModule, OAuthLoginModule) if you want to know how to obtain HTTP Session. Another alternative is to use ThreadLocal instead of HTTP Session, which should work during Servlet 3.0 login via HTTP.

          - In login.jsp, you will need to read content of the attribute from HTTP session and if flag is here, you know that login failed because user is already logged in different session.

           

          Marek