1 Reply Latest reply on Apr 18, 2011 11:17 AM by Jose Augusto Conde

    Sharing security context between 2 web applications

    Jose Augusto Conde Newbie


      I´m trying to share a security context between 2 web applications. The first one is a real web application and the other one is an image repository. The image repository has to be protected against non authenticated users.

      To do this I´ve created this LoginModule configuration in login-config.xml :

      <application-policy name="ativaDomain">
               <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
                       <!-- users and roles for tests -->
                    <module-option name="usersProperties">props/ativa-users.properties</module-option>
                    <module-option name="rolesProperties">props/ativa-roles.properties</module-option>

      The components.xml look like this :

      <security:identity jaas-config-name="ativaDomain" />

      In login.page.xml is configured to raise loginEvent. I capture this event to load some user information into the session context :

      <navigation from-action="#{identity.login}" >
            <rule if="#{identity.loggedIn}">
                  <raise-event type="loginEvent"/>
               <redirect view-id="/paginas/funcionalidades/home.xhtml"/>

      In the second application (the image repository), I´ve made this configuration in web.xml, allowing admin role to access to image repository:

          <display-name>Restrict Documents</display-name>
            <web-resource-name>Todos os recursos</web-resource-name>

        • 1. Re: Sharing security context between 2 web applications
          Jose Augusto Conde Newbie

          I set the security-domain in jboss-web.xml, for both applications :

               <class-loading java2ClassLoadingCompliance="false">

          And finaly, I´m using the SingleSignOn Valve, configured in deploy\jbossweb.sar\server.xml.

          <Valve className="org.apache.catalina.authenticator.SingleSignOn"/>

          With all this configuration, I can login in the first application, but when I try to acces the second application (the image repository) the application show me the browser login page, requesting username and password.

          I´ve tried to put the jmx-console application using my LoginModule configuration and the SSO works fine with the image repositoty application. It doesnt work with the first application.

          Is there something wrong? Or Jboss Seam doesnt work with the SSO Valve?

          Thanx and sorry for my bad english,

          Jose Augusto Conde
          Brasilia / Brazil