2 Replies Latest reply on Nov 25, 2004 3:14 AM by starksm64

    After Authentication EJB context returning anonymous user

    suthakar

      Hi All,

      I'm having one problem while running my application in Jboss 3.2.5 & 4.0.0. After successfull authentication from the EJB context it is returning the default unauthendicated user 'anonymous'. In 3.2.5 it is returning null.

      Here the jboss trace info. TIA.

      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.SecurityAssociationValve - jsp, runAs: null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.SecurityAssociationValve - PageController, runAs: null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.SecurityAssociationValve - default, runAs: null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.SecurityAssociationValve - default, runAs: null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.SecurityAssociationValve - default, runAs: null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.SecurityAssociationValve - default, runAs: null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.SecurityAssociationValve - default, runAs: null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.SecurityAssociationValve - default, runAs: null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.JBossSecurityMgrRealm - Begin authenticate, username=TESTUSERsystem
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.security.plugins.JaasSecurityManager - Constructing
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG org.jboss.security.plugins.JaasSecurityManagerService - Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@11afdf4
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG org.jboss.security.plugins.JaasSecurityManager.TESTUSERauthentication - CachePolicy set to: org.jboss.util.TimedCachePolicy@5161e1
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG org.jboss.security.plugins.JaasSecurityManagerService - setCachePolicy, c=org.jboss.util.TimedCachePolicy@5161e1
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG org.jboss.security.plugins.JaasSecurityManagerService - Added TESTUSERauthentication, org.jboss.security.plugins.SecurityDomainContext@f10a53 to map
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.security.auth.login.XMLLoginConfigImpl - Begin getAppConfigurationEntry(TESTUSERauthentication), size=11
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.security.auth.login.XMLLoginConfigImpl - End getAppConfigurationEntry(TESTUSERauthentication), authInfo=AppConfigurationEntry[]:
      [0]
      LoginModule Class: test.appserver.jboss.LoginModule
      ControlFlag: LoginModuleControlFlag: required
      name=dsJndiName, value=java:/OracleDS

      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - starting initialize()
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.AuthenticatorDatabase - getInstance() returning test.appserver.jboss.AuthenticatorDatabase@721098
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - end initialize()
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - starting login()
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - starting getCallbacks()
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - returning getCallbacks() [Ljavax.security.auth.callback.Callback;@351fbf
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - login() !m_isIdentityAssertion=true
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - login() m_userName.length()=13
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.AuthenticatorDatabase - dataSourceName=java:/OracleDS
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.AuthenticatorDatabase - Authenticating user 'TESTUSERsystem' => success
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - login() m_loginSucceeded=true
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - login() m_loginSucceeded=true
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - login() m_sharedState.get(javax.security.auth.login.name)=true
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - login() returning m_loginSucceeded=true
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - starting commit()
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - starting commit() m_loginSucceeded=true
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - commit()
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.appserver.jboss.LoginModule - ending commit() returning true
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.security.plugins.JaasSecurityManager.TESTUSERauthentication - updateCache, subject=Subject:
      Principal: Roles(members:TESTUSER)
      Principal: TESTUSER

      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.JBossSecurityMgrRealm - User: TESTUSERsystem is authenticated
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.JBossSecurityMgrRealm - Mapped from input principal: TESTUSERsystemto: TESTUSERsystem
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.JBossSecurityMgrRealm - End authenticate, principal=GenericPrincipal[TESTUSERsystem(TESTUSER,)]
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.web.tomcat.security.SecurityAssociationValve - PageController, runAs: null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.StatelessSessionContainer - METHOD HOME INVOKE 299363375||create||[Ljava.lang.Object;@4633e7
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - Start method=create
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Current transaction in MI is null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - TX_REQUIRED for create timeout=0
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Thread came in with tx null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Starting new tx TransactionImpl:XidImpl[FormatId=257, GlobalId=tester/26, BranchQual=, localId=26]
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - TxInterceptorCMT: In finally
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - End method=create
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.StatelessSessionContainer - METHOD REMOTE INVOKE 299363375||getPrincipalName||
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - Start method=getPrincipalName
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Current transaction in MI is null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - TX_SUPPORTS for getPrincipalName
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Thread came in with tx null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.StatelessSessionInstancePool - Get instance org.jboss.ejb.plugins.StatelessSessionInstancePool@123e82b#0#class test.authorization.LogonTestBean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.ejb.BaseSessionBean - In setSessionContext: ctx is not null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG test.ejb.BaseSessionBean - In BaseSessionBean:ejbCreate()
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.StatelessSessionInstancePool - 0/100 Free instance:org.jboss.ejb.plugins.StatelessSessionInstancePool@123e82b#null#null#true#class test.authorization.LogonTestBean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - End method=getPrincipalName
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.StatelessSessionContainer - METHOD REMOTE INVOKE 299363375||remove||
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - Start method=remove
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Current transaction in MI is null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - TX_SUPPORTS for remove
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Thread came in with tx null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.StatelessSessionInstancePool - Get instance org.jboss.ejb.plugins.StatelessSessionInstancePool@123e82b#1#class test.authorization.LogonTestBean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG org.jboss.ejb.StatelessSessionContainer - Useless invocation of remove() for stateless session bean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.StatelessSessionInstancePool - 0/100 Free instance:org.jboss.ejb.plugins.StatelessSessionInstancePool@123e82b#null#null#true#class test.authorization.LogonTestBean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - End method=remove
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.StatelessSessionContainer - METHOD REMOTE INVOKE -1437622808||find||
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - Start method=find
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Current transaction in MI is null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - TX_REQUIRED for find timeout=0
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Thread came in with tx null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Starting new tx TransactionImpl:XidImpl[FormatId=257, GlobalId=tester/27, BranchQual=, localId=27]
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.StatelessSessionInstancePool - Get instance org.jboss.ejb.plugins.StatelessSessionInstancePool@1b81d4f#3#class test.omi.EntityManagerSLBean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.StatelessSessionInstancePool - 2/100 Free instance:org.jboss.ejb.plugins.StatelessSessionInstancePool@1b81d4f#null#TransactionImpl:XidImpl[FormatId=257, GlobalId=tester/27, BranchQual=, localId=27]#true#class test.omi.EntityManagerSLBean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - TxInterceptorCMT: In finally
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - End method=find
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.StatelessSessionContainer - METHOD REMOTE INVOKE -1437622808||remove||
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - Start method=remove
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Current transaction in MI is null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - TX_REQUIRED for remove timeout=0
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Thread came in with tx null
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - Starting new tx TransactionImpl:XidImpl[FormatId=257, GlobalId=tester/28, BranchQual=, localId=28]
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.StatelessSessionInstancePool - Get instance org.jboss.ejb.plugins.StatelessSessionInstancePool@1b81d4f#3#class test.omi.EntityManagerSLBean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] DEBUG org.jboss.ejb.StatelessSessionContainer - Useless invocation of remove() for stateless session bean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.StatelessSessionInstancePool - 2/100 Free instance:org.jboss.ejb.plugins.StatelessSessionInstancePool@1b81d4f#null#TransactionImpl:XidImpl[FormatId=257, GlobalId=tester/28, BranchQual=, localId=28]#true#class test.omi.EntityManagerSLBean
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.TxInterceptorCMT - TxInterceptorCMT: In finally
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] TRACE org.jboss.ejb.plugins.LogInterceptor - End method=remove
      11-25-04:12:56 [http-0.0.0.0-9000-Processor25] ERROR test.LoggedExceptionSupport - test.authorization.AuthorizationException: Unable to authorize user null


      In ejb-jar.xml i have mentioned my security domain

      <enterprise-beans>
      Logon Manager
      <security-domain>java:/jaas/test</security-domain>

      <ejb-name>test.authorization.Logon</ejb-name>
      <jndi-name>test.authorization.LogonHome</jndi-name>

      </enterprise-beans>
      <resource-managers/>




      Thanks.

        • 1. Re: Step debugging JSP pages
          starksm64

          Hi,

          Well, I think this feature is in the 1.4.0 release. I don't remember if it has been tested extensively.

          Laurent

          • 2. Re: After Authentication EJB context returning anonymous use
            suthakar

            Still i'm facing this problem.

            Scott, i'm expecting reply from you. Please help me out on this error.

            I'm using javax.security.auth.spi.LoginModule interface directly. Here user Authentication completed successfully but after that when the first time EJB invoked it is returning anonymous. In the second time when it is invoked it is retuurning the properuser who has logged in.

            Thanks.