code: public static String createToken(CmsObject cms, CmsUser user, long currentTime) throws CmsException {
  
          String randomKey = RandomStringUtils.randomAlphanumeric(8);
          String value = CmsEncoder.encodeStringsAsBase64Parameter(Arrays.asList(randomKey, "" + currentTime));
          user.setAdditionalInfo(ADDINFO_KEY, value);
          cms.writeUser(user);
          return CmsEncoder.encodeStringsAsBase64Parameter(Arrays.asList(user.getName(), randomKey));
      }
docs: Creates a new token for the given user and stores it in the user's additional info.<p>
  
  @param cms the CMS context
  @param user the user
  @param currentTime the current time
  @return the authorization token
  @throws CmsException if something goes wrong