code: private void setUpTemporarySubject() throws Exception {
          temporarySubject = new Subject();
          String accessId = AccessIdUtil.createAccessId(AccessIdUtil.TYPE_USER,
                                                        userRegistry.getRealm(),
                                                        userRegistry.getUniqueUserId(urAuthenticatedId));
          setWSPrincipal(temporarySubject, username, accessId, WSPrincipal.AUTH_METHOD_PASSWORD);
          setCredentials(temporarySubject, username, urAuthenticatedId);
          setOtherPrincipals(temporarySubject, username, accessId, WSPrincipal.AUTH_METHOD_PASSWORD, null);
      }
docs: /*
  Populate a temporary subject in response to a successful authentication.
  We use a temporary Subject because if something goes wrong in this flow,
  we are not updating the "live" Subject. If performance is a problem, it may
  be necessary to create a placeholder instead of a subject and modify the credentials
  service to return a set of credentials or update the holder in order to place in
  the shared state.