Sun OpenSSO Enterprise 8.0 Integration Guide

Modifying the OpenSSO Login Page

Embed code into the OpenSSO Enterprise Login.jsp file that will save the URL in the HTTP request parameter goto. This URL is required by the ChangePassword.jsp that you created in the section To Create a New ChangePassword.jsp File. Once saved, the URL can be passed onto Identity Manager. Identity Manager later redirects the user to that URL.

The URL in the HTTP request parameter goto is the original URL requested by the user, before he was redirected to OpenSSO Enterprise for login.

You can manually change the deployed Login.jsp file, or you can use the sample Login.jsp included with the opensso.zip download. Choose only one of the following procedures:

ProcedureTo Modify a Deployed Login.jsp File

  1. Use a text editor to open the file web-container-deploy-base/opensso/config/auth/default/Login.jsp and add the sections of code displayed in bold the following example:


    ...
    
    <%
    
    String ServiceURI = (String) viewBean.getDisplayFieldValue(viewBean.SERVICE_URI);
    String encoded = "false";
    String gotoURL = (String) viewBean.getValidatedInputURL(
    request.getParameter("goto"), request.getParameter("encoded"), request);
    String encodedQueryParams = (String) viewBean.getEncodedQueryParams(request);
    if ((gotoURL != null) && (gotoURL.length() != 0)) {
    encoded = "true";
    
    }
    
    String replaygotoURL = "";
    String goToURL = request.getParameter("goto");
    if(gotoURL != null && !gotoURL.equals("null") && (gotoURL.length() > 0)){
    replaygotoURL = "&goto=" + goToURL;
    
    }
    
    System.out.println("replaygotoURL: " + replaygotoURL);
    %>
    
    
    <link rel="stylesheet" href="<%= ServiceURI %>/css/styles.css" type="text/css" />
    <script language="JavaScript" src="<%= ServiceURI %>/js/browserVersion.js"></script>
    <script language="JavaScript" src="<%= ServiceURI %>/js/auth.js"></script>
    
    ...
    
    
    <input type="hidden" name="goto" value="<%= gotoURL %>">
    <input type="hidden" name="SunQueryParamsString" value="<%= encodedQueryParams %>">
    <input type="hidden" name="encoded" value="<%= encoded %>">
    
    <input type="hidden" name="plaingoto" value="<%= request.getParameter("goto") %>">
    </auth:form>
    
    </jato:content>
    
    
    ...
  2. Remove the web container's temporary, compiled JSP to ensure that the changes made are picked up.

    For example, if you are using GlassFish, the temporary, compiled classes are in the glassfish-home/domains/your-domain/generated/ directory.

  3. Restart the OpenSSO Enterprise web container after making the changes.

ProcedureTo Use the Sample Login.jsp

  1. Locate the file opensso/integrations/idm/jsps/Login.jsp in the decompressed opensso.zip distribution.

  2. Replace the deployed web-container-deploy-base/opensso/config/auth/default/Login.jsp file.

    Choose only one of the following two options:

    You can replace your existing Login.jsp with the sample Login.jsp. If you choose this option, the following will occur:

    • You will lose any custom changes made to the existing Login.jsp.

    • You will inherit changes that might have been previously made to the sample Login.jsp to incorporate requirements for other use cases related to the OpenSSO integration with Identity Manager.

    • You must change the Identity Manager URL embedded in the sample Login.jsp to reflect the Identity Manager system URL of your architecture.

      You can search for the string /idm to locate the URLs.

    Alternatively, you can make the changes manually. If you choose this option, first run the diff command to view the differences between the deployed Login.jsp and the sample Login.jsp, and then make the changes manually.

  3. Remove the web containers temporary, compiled JSP to ensure that the changes made are picked up.

    For example, if you are using GlassFish, the temporary, compiled classes is in the glassfish-home/domains/your-domain/generated/ directory.

  4. Restart the OpenSSO web container after making the changes.