2 Replies Latest reply on Jun 18, 2003 3:03 AM by johndoekyrgyz

    Authentication Exception

    vbfischer

      I'm now getting an error:

      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerException: EJBException:; nested exception is:
      javax.ejb.EJBException: checkSecurityAssociation; CausedByException is:
      Authentication exception, principal=

      (I've attached complete output.txt).

      I feel I'm close. My gut feeling is that the username and password I'm passing is not correct, even though they should be. I'm getting past the lc.login(), but from what I understand, is just putting the principal and subject in the session (JBoss session).

      I've included other relavant files as attachments in the hopes that someone can point me in the right direction.

        • 1. Re: Authentication Exception
          vbfischer

          I should mention some other details.

          Client is program accessing Session Bean. Session bean is simple Echo.
          Environment:

          JBoss 3.2.0_tomcat 4.1.24

          MSSQL Server 2000.

          Server is local (servername = MUSIC)

          Table definitions are:
          user BPW_USER is database owner of Daytona database.

          CREATE TABLE [dbo].[SYS_USER] (
          [USERNAME] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
          [USERTYPE] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
          [PASSWORD] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
          [FULLNAME] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
          [ALLOWINSERT] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
          [ALLOWEDIT] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
          [ALLOWDELETE] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
          [ALLOWVIEW] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
          [ALLOWOTHER] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
          [OPTIONS] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
          ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
          GO

          CREATE TABLE [dbo].[USER_ROLES] (
          [username] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
          [userRoles] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
          ) ON [PRIMARY]

          Thanks in advance.

          • 2. Re: Authentication Exception
            johndoekyrgyz

            This is a fairly common problem. What is the command line you use to start the client? It should be something like this.

            java -Djava.security.manager -Djava.security.auth.login.config=auth.conf -Djava.security.policy=client.policy -Djava.security.auth.policy=client.policy
            [your java class]

            The auth.conf file specifies the JAAS login modules that should be invoked inorder to create a login context, ie lc.login(). Here is an example of one that I use.

            CitiHopeSecurityDomain
            {
            org.jboss.security.ClientLoginModule Required;
            };

            Note: CitiHopeSecurityDomain is the name of the login configuration that I use. This file can contain multiple configurations. You reference a particular configuration in your code like this.

            LoginContext lc = new LoginContext("CitiHopeSecurityDomain", handler);

            Here is my client.policy file.

            grant
            {
            permission java.security.AllPermission;
            };

            Your server configuration looks fine on first glance.

            There is a good article on JBossSX available on JavaWorld that covers most of what you are trying to do.

            Good Luck,
            John