Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-6159

UserPrincipal search in RemotingLoginModule seems to be broken

XMLWordPrintable

      The code of UserPrincipal search in RemotingLoginModule seems to be invalid.
      There's

      UserPrincipal up = null;
      for (Principal current : con.getPrincipals()) {
          if (current instanceof UserPrincipal) {
              up = (UserPrincipal) current;
          }
          break;
      }
      

      but IMO, the correct code is:

      UserPrincipal up = null;
      for (Principal current : con.getPrincipals()) {
          if (current instanceof UserPrincipal) {
              up = (UserPrincipal) current;
              break;
          }
      }
      

      If the connection from RemotingContext contains more Principals, then only the first is checked. I.e. If the first Principal is not an UserPrincipal, then the RemotingLoginModule doesn't work.

              josef.cacek@gmail.com Josef Cacek (Inactive)
              josef.cacek@gmail.com Josef Cacek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: