Uploaded image for project: 'PicketBox '
  1. PicketBox
  2. SECURITY-631

Possibility to choose principal identity from FORM authentication

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • Negotiation_2_0_4
    • Negotiation_2.1.0
    • Negotiation
    • None

      Currently method SPNEGOLoginModule.usernamePasswordLogin() is performing FORM-based authentication and when authenticates, it choose first principal from obtained subject and call setIdentity() with this principal.

      In EPP login modules, our subject has more principals and user principal is not returned as first principal of subject. For handle this situation, it will be nice to have this functionality in protected method like:

         protected Principal getIdentityFromSubject(Subject userSubject)
         { 
            Set principals = userSubject.getPrincipals();
            if (principals.isEmpty())
            {
               throw new LoginException("No principal returned after login.");
            }
            else if (principals.size() > 1)
            {
               log.warn("Multiple principals returned, using first principal in set.");
            }
      
            Principal identity = (Principal) principals.iterator().next();
            return identity;
          }
      

      which will be called from usernamePasswordLogin(). So that it will be possible to create subclass of SPNEGOLoginModule and override functionality of always choosing first principal.

            darran.lofthouse@redhat.com Darran Lofthouse
            mposolda@redhat.com Marek Posolda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: