2 Replies Latest reply on Jan 2, 2004 8:43 AM by fs_cos

    using RunAsLoginModule

    bhawanakatiyar

      Hello,

      I have a custom loginmodule that uses an EJB to authenticate user in its login() method. The methods in the EJB are unchecked but there was no identity so login module was being invoked recursively. So, I added RunAsLoginModule to my login module stack.
      I use RunAsLoginModule to set a runAs role.

      My login-config.xml has the follwoing entry:
      *******************************************
      <application-policy name = "csb">

      <login-module code = "org.jboss.security.auth.spi.RunAsLoginModule"
      flag = "required" >
      </login-module>

      <login-module code = "com.vcorp.csb.security.auth.spi.UsersRolesLoginModule"
      flag = "required" >
      </login-module>


      </application-policy>

      *******************************************
      I still get the follwoing exception (Full stack trace is attached):

      16:50:13,937 ERROR [SecurityInterceptor] Authentication exception, principal=null
      16:50:13,937 ERROR [LogInterceptor] EJBException, causedBy:
      java.lang.SecurityException: Authentication exception, principal=null
      at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:164)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:81)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      at org.jboss.ejb.StatelessSessionContainer.internalInvokeHome(StatelessSessionContainer.java:319)
      at org.jboss.ejb.Container.invoke(Container.java:720)
      ***********************************



      Has anyone used RunAsLoginModule successfully.

      Thanks in advance
      Bhawana

        • 1. Re: using RunAsLoginModule
          fs_cos

          Hi

          did you find out how it works?? If so could you please let me know??

          Thanks

          • 2. Re: using RunAsLoginModule
            fs_cos

            I think I found the answer:

            The own login module in the secutity-config.xml has to be set to sufficient

            <application-policy name="spedOnline">

            <login-module code="org.jboss.security.auth.spi.RunAsLoginModule" flag="required">
            <module-option name="roleName">Login</module-option>
            </login-module>
            <login-module flag="sufficient" code="com.cosomex.spedonline.security.SpedOnline_LoginModul"/>

            </application-policy>

            Frank