Blocking/Redirecting Access to the IdP Portal

What is the best way to block or "hide" the IdP User Portal in NAM?  For years, I would simply modify the main.jsp page on the IdP and add something like the following:

if (hand.isAuthenticatedSession()) { String redirectURL = "">"; response.sendRedirect(redirectURL); }


Right after this line:


ContentHandler hand = new ContentHandler(request,response);


I believe this solution was originally given to me years ago by support.  

Recently while working on a site where I was doing a step-up contract for some protected resources I noticed that my modifications broke the execution of the step-up contract (thew an error when calling nidp.jsp from main.jsp).  Removing my modifications fixed it.  However, I still need a way to block/hide access to the IdP Portal.  What is the best way to do this now?