anchor.diff:      boolean error = IdentityManagementEndpointUtil.getBooleanValue(request.getAttribute("error"));
       String errorMsg = IdentityManagementEndpointUtil.getStringValue(request.getAttribute("errorMsg"));
       String username = request.getParameter("username");
  -    if (StringUtils.isNotEmpty(username)) {
  -        User user = IdentityManagementServiceUtil.getInstance().getUser(username);
  -        tenantDomain = user.getTenantDomain();
  +    boolean isSaaSApp = Boolean.parseBoolean(request.getParameter("isSaaSApp"));
  +
  +    if (StringUtils.isBlank(tenantDomain)) {
  +        tenantDomain = IdentityManagementEndpointConstants.SUPER_TENANT;
       }
  +    
  +    // The user could have already been resolved and sent here.
  +    // Trying to resolve tenant domain from user to handle saas scenario.
  +    if (isSaaSApp &&
  +            StringUtils.isNotBlank(username) &&
  +            !IdentityTenantUtil.isTenantQualifiedUrlsEnabled() &&
  +            StringUtils.equals(tenantDomain, IdentityManagementEndpointConstants.SUPER_TENANT)) {
  +        
  +        tenantDomain = IdentityManagementServiceUtil.getInstance().getUser(username).getTenantDomain();
  +    }
  +
       ReCaptchaApi reCaptchaApi = new ReCaptchaApi();
       try {
           ReCaptchaProperties reCaptchaProperties = reCaptchaApi.getReCaptcha(tenantDomain, true, "ReCaptcha",
                   "password-recovery");
  +
           if (reCaptchaProperties.getReCaptchaEnabled()) {
               Map<String, List<String>> headers = new HashMap<>();
               headers.put("reCaptcha", Arrays.asList(String.valueOf(true)));
  
positive.code:         request.getRequestDispatcher("error.jsp").forward(request, response);
          return;
      }
      boolean isEmailNotificationEnabled = false;
      isEmailNotificationEnabled = Boolean.parseBoolean(application.getInitParameter(
              IdentityManagementEndpointConstants.ConfigConstants.ENABLE_EMAIL_NOTIFICATION));
  %>
  <%
      boolean reCaptchaEnabled = true;
      if (request.getAttribute("reCaptcha") != null &&
              "TRUE".equalsIgnoreCase((String) request.getAttribute("reCaptcha"))) {
          reCaptchaEnabled = true;
  
negative.code:                         %>
  
                          <%
                              String sessionDataKey = request.getParameter("sessionDataKey");
                              if (sessionDataKey != null) {
                          %>
                          <div>
                              <input type="hidden" name="sessionDataKey"
                                     value="<%=Encode.forHtmlAttribute(sessionDataKey) %>"/>
                          </div>
                          <%
                              }
                          %>
  
                          <%
                              if (reCaptchaEnabled) {
                          %>
                          <div class="field">
  