2 Replies Latest reply on Feb 18, 2013 8:27 PM by Artur Drummond

    Sharing session between wars inside one ear

    Artur Drummond Newbie

      Hi all,

       

      I'm implementing a new software and I'd like to ask you guys some opinions about this architecture.

       

      In this new software I'm going to have many wars inside one ear. One of this war is going to be responsible for creating a new session. The others should not create new session. Instead they must use the session created previously.

       

      I'm using JbossAS 7 and I can't find a way to share session using the server configuration. I'm aware that there's a JSR defining that this should not be available.

       

      Looking for alternatives, some developers suggested:

       

      a) Use SAML with PicketLink and they should manage the login and security of my applications. I should use sp and idp for comunication.

       

      b) Create a jar inside ear but outside other wars. This jar would be responsible for this comunication.

       

       

      I read something about Jboss storing sessions inside Infinispan but I can't find further information.

       

      What do you guys can suggest me?

       

      Regards,

        • 1. Re: Sharing session between wars inside one ear
          Radoslav Husar Master

          I'm using JbossAS 7 and I can't find a way to share session using the server configuration. I'm aware that there's a JSR defining that this should not be available.

          Sorry, but doesn't ring a bell, can you link the spec you are referring to?

           

          a) Use SAML with PicketLink and they should manage the login and security of my applications. I should use sp and idp for comunication.

          Yes ,this is correct. This is the right approach, but IIUC this wont expose the HTTP session object, but just log a user withing apps or in clustered SSO, withing servers of the cluster.

           

          See the quickstarts from picketlink on how to do this:

          https://github.com/picketlink/picketlink-quickstarts

          b) Create a jar inside ear but outside other wars. This jar would be responsible for this comunication.

          Not really following, could you elaborate?

          I read something about Jboss storing sessions inside Infinispan but I can't find further information.

          Correct, sessions are stored in Infinispan caches. See the Infinispan subsystem configuration. This is managed by server, I don't think you want to hack around internals.

          • 2. Re: Sharing session between wars inside one ear
            Artur Drummond Newbie

            Thanks for your reply Radoslav,

             

            actually, I was wondering in another solution for this problem.

             

            I've mentioned Infinispan and session storing because I was thinking about sharing sessions between wars using one NoSql database.

             

            As JBoss already contains Infinispan, it's easier to create a new Cache management and use it to share session.

             

            What do you think about this idea?

            The Infinispan new Cache created could be embedded within the ear.