code: public static void populateSubject(final LinkedHashMap<String, CommonProfile> profiles) {
          if (profiles != null && profiles.size() > 0) {
              final List<CommonProfile> listProfiles = ProfileHelper.flatIntoAProfileList(profiles);
              try {
                  if (IS_FULLY_AUTHENTICATED_AUTHORIZER.isAuthorized(null, listProfiles)) {
                      SecurityUtils.getSubject().login(new Pac4jToken(listProfiles, false));
                  } else if (IS_REMEMBERED_AUTHORIZER.isAuthorized(null, listProfiles)) {
                      SecurityUtils.getSubject().login(new Pac4jToken(listProfiles, true));
                  }
              } catch (final HttpAction e) {
                  throw new TechnicalException(e);
              }
          }
      }
docs: Populate the authenticated user profiles in the Shiro subject.
  
  @param profiles the linked hashmap of profiles