First login: Creation of a link for the first access of a new user ( without give the user a password and forcing him to set one)

This post could be useful if you want to give to a user a link for access your portal, without the need of a password, and then force him to create a password at his fist login.

You can, for example, send an email after the sign up with a link that allows the user change its password.
  1. Create your user
  2. Define the parameter:
    • PLATFORM_BASE_URL (you can find it in 4WS.Platform), in this case:
      Note: this parameter is also needed for the forgotten password function.
  3. Create you link in this way:
var rtk = utils.getEncodedRtk("applicationId=" + APPLICATION_ID + "&companyId=" + COMPANY_ID + "&siteId=" + SITE_ID + "&username=" + USER_ID + "&password=" + PASSWORD + "&forgotpwd=Y" + "&appTitle=" + APP_TITLE);

var firstLoginUrl = utils.getParameter("PLATFORM_BASE_URL");
firstLoginUrl += '/4ws/index_app.jsp?rtk=';
firstLoginUrl += rtk;
  • The following parameters specified in the function must be the new user ones
    • SITE_ID
    • USER_ID
  • In this case a temporary password for the user was manually generated and sent by email.