code: private void handleCollectiveLogin(X509Certificate certChain[], CollectiveAuthenticationPlugin plugin,
                                         boolean collectiveCert) throws InvalidNameException, AuthenticationException, Exception {
          // If the chain is not authenticated, it will throw an AuthenticationException
          plugin.authenticateCertificateChain(certChain, collectiveCert);
          X509Certificate cert = certChain[0];
          X500Principal x509Subject = cert.getSubjectX500Principal();
          String accessId = AccessIdUtil.createAccessId(AccessIdUtil.TYPE_SERVER,
                                                        "collective",
                                                        x509Subject.getName());
          username = x509Subject.getName();
          authenticatedId = x509Subject.getName();
          addCredentials(accessId);
      }
docs: Handles a collective certificate login.
  
  @param certChain
  @param x509Subject
  @throws InvalidNameException
  @throws AuthenticationException
  @throws Exception