1 Reply Latest reply on Jun 19, 2003 11:27 AM by Peter Doornbosch

    authentification failed! help please

    pognon Newbie

      This is my problem:
      I have two entities beans that reprent two banks: Bank1Bean and Bank2Bean
      and two stateless session bean: Bank1ManagerBean and Bank2ManagerBean

      I define 4 roles : Bank1ClientRole- Bank2CLientRole
      Bank1ManagerRole Bank2ManagerRole.

      my ejb-jar file looks like this--------------->

      <security-role-ref>
      <role-name>Bank1ClientRole</role-name>
      <role-link>Bank1ClientRole</role-link>
      </security-role-ref>

      <security-role-ref>
      <role-name>Bank1ManagerRole</role-name>
      <role-link>Bank1ManagerRole</role-link>
      </security-role-ref>

      Same thing for the two other beans.

      Now I define this in the auth.conf ( on the server and client side):----------------------->

      UsersRolesLoginModule {
      // A properties file LoginModule that supports CallerPrincipal mapping
      org.jboss.security.auth.spi.UsersRolesLoginModule required
      usersProperties=users.properties
      rolesProperties=roles.properties
      ;
      };

      I write this in the login-config.xml file on the server side---------------------->

      <application-policy name = "UsersRolesLoginModule">
      <!-- simple users and roles login module -->

      <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
      flag = "required">
      <module-option name = "rolesProperties">roles.properties</module-option>
      <module-option name = "usersProperties">users.properties</module-option>
      </login-module>

      </application-policy>

      I put the roles.properties and users.properties files in my jar.
      But when i run the client the Bank1ManagerClient i reiceve this message:-------------------------->

      F:\projetFirst>java %VMARGS% -classpath %CLASSPATH% BankUbsManagerClient UbsMana
      ger UbsManager create
      Created LoginContext
      Login completed
      Ubs manager try to connect
      Ubs manager is now connected
      java.rmi.ServerException: RemoteException occurred in server thread; nested exce
      ption is:
      java.rmi.ServerException: EJBException:; nested exception is:
      javax.ejb.EJBException: checkSecurityAssociation; nested exception is: j
      ava.lang.SecurityException: Authentication exception, principal=UbsManager
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)


      Who can help me please where is my error?
      Thx