Skip to Content
0
Jun 05, 2014 at 10:45 PM

redirect after successful authentication

31 Views

Hi Experts,

I am trying to redirect the users to a different portal component after they are successfully authenticated, as I need the details of the authenticated user, especially the R3Name that was mapped to. I have done the below modifications in umLogonPage.jsp of the logon application:

  1. Deleted the form action:
onaction="<%=inPortal?"":logonBean.getLogonURL(proxy, null)%>";

2. Deleted the onSubmit of the form:

?"onSubmit=\"javascript:addTenantPrefix();\"":""

3. Changed the type of logon button to button from submit.

4. Then, I have added the below script in the umLogonPage.jsp which is being called onclick of the logon button:

function payrollPnumCheck()
{
  addTenantPrefix();
  var logonAction =  "<%=inPortal?"":logonBean.getLogonURL(proxy, null)%>";
  <%
  boolean locked = PayrollStatus.isPayrollProcessing();
  if((locked)){
  %>
  alert(location.pathname);
  window.location.assign("http://zabrysvsapzhd:50000/irj/servlet/prt/portal/prtroot/com.dd.payrollProcessing.systemLocked");
  <%
  }else{%>
  document.logonForm.action=logonAction;
    document.logonForm.submit();
  <%}%>
}

But, the portal is not being redirected after the authentication.

Please let me know what am I doing wrong here. I am quite new to js and jsp.

Thank you,

Sai