code: protected void setCredentials(Subject subject,
                                    String securityName,
                                    String urAuthenticatedId) throws Exception {
  //        Principal principal = new WSPrincipal(securityName, accessId, authMethod);
          if (urAuthenticatedId != null && !urAuthenticatedId.equals(securityName)) {
              Hashtable<String, String> subjectHash = new Hashtable<String, String>();
              subjectHash.put(AuthenticationConstants.UR_AUTHENTICATED_USERID_KEY, urAuthenticatedId);
              subject.getPrivateCredentials().add(subjectHash);
  
          }
          CredentialsService credentialsService = getCredentialsService();
          credentialsService.setCredentials(subject);
      }
docs: Set the relevant Credentials for this login module into the Subject,
  and set the credentials for the determined accessId.
  
  @throws Exception