5 Replies Latest reply on Sep 14, 2011 5:42 PM by Sebastian Sachtleben

    Different login successful message.

    Heiko Tappe Newbie

      What would be the best way to have a different login-successful message? I would like to display the user's name instead of the id.
      When I declare an @Alternative for SecurityEventMessages I still additionally get the message declared in the original SecurityEventMessages class.


      --Heiko

        • 1. Re: Different login successful message.
          Jan Groth Novice

          Using Seam-Config to configure SecurityEventMessages should be a good way...


          I'd try to use @Alternative in conjunction with overwriting SecurityEventMessages


          enabled = true



          to


          enabled = false





          • 2. Re: Different login successful message.
            Heiko Tappe Newbie

            Thanks Jan. I've got it working now :-)


            The most important hint was the enabled property. I only had a look at CR2 - and there wasn't such a property at that time.


            Disabling SecurityEventMessages via seam-config and using my own observer on PostAuthenticate did the trick.


            --Heiko

            • 3. Re: Different login successful message.
              Jan Groth Novice


              I only had a look at CR2 - and there wasn't such a property at that time.


              Yep, Seam 3 is still rather a fluent API, at least in some places ;-)


              • 4. Re: Different login successful message.
                Miroslav Dzhokanov Newbie
                Heiko, could you share your beans.xml? I modified mine according to the Seam-Config documentation, but the Login Successful message keeps coming up. Here is my beans.xml:

                <?xml version="1.0"?>
                <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xmlns:s="urn:java:ee"
                     xmlns:security="urn:java:org.jboss.seam.security"
                     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">

                        <!-- this works correctly -->
                     <security:IdentityImpl>
                          <s:modifies />
                          <security:authenticatorName>UsersAuthenticator
                          </security:authenticatorName>
                     </security:IdentityImpl>

                     <!-- event messages keep coming up -->
                     <security:SecurityEventMessages>
                          <s:modifies />
                          <security:enabled>false</security:enabled>
                     </security:SecurityEventMessages>
                     
                </beans>
                • 5. Re: Different login successful message.
                  Sebastian Sachtleben Novice

                  Not sure about the beans.xml configuration, but you could inject SecurityEventMessages and set enabled false.


                  The messages will be disabled by default with the upcoming 3.1.0 release.