Sun OpenSSO Enterprise 8.0 Integration Guide

Modifying the OpenSSO Enterprise Login Page

Modify the opensso/config/auth/default/Login.jsp page to include a Register User button. 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 Manually Modify a Deployed Login.jsp

  1. Use a text editor to open the file /web-container-deploy-base/opensso/config/auth/default/Login.jsp .

  2. Add the sections of code displayed in bold in 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>
    
    
    ...
    
    
    function LoginSubmit(value) {
    aggSubmit();
    var hiddenFrm = document.forms['Login'];
    
    if (hiddenFrm != null) {
    hiddenFrm.elements['IDButton'].value = value;
    
    if (this.submitted) {
    alert("The request is currently being processed");
    
    }
    
    else {
    
    this.submitted = true;
    hiddenFrm.submit();
    
    }
    
    }
    
    }
    
    
    function RegisterUser() {
    window.location = "http://HostName.DomainNamecom:6480/idm/authutil/
          anonEnrollment.jsp?id=endUserAnonymousEnrollment<%=replaygotoURL%>";
    
    }
    
    
    ...
    
    
    <jato:content name="hasNoButton">
    
    <tr>
    
    <td><img src="<%= ServiceURI %>/images/dot.gif"
    width="1" height="15" alt="" /></td>
    
    <td>
    <table border=0 cellpadding=0 cellspacing=0>
    <script language="javascript">
    markupButton(
    '<jato:text name="lblSubmit" />',
    "javascript:LoginSubmit('<jato:text name="lblSubmit" />')");
    </script>
    
    <script language="javascript">
    markupButton(
    'Register User',
    "javascript:RegisterUser()");
    </script>
    </table>
    </td>
    
    </tr>
    
    <!-- end of hasNoButton -->
    
    </jato:content>
    
    
    ...
    
    
    <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>
    
    
    ...
  3. Remove the web container's temporary, compiled JSP to ensure that the changes made are picked up.

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

  4. 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 opensso.zip distribution.

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

    Choose one of the following options:

    You can you 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 Login.jsp to reflect your Identity Manager system URL. Search for the string /idm in the sample Login.jsp file to locate these URLs.

    Alternatively, you can manually make the changes to the file. If you choose this option, run the diffcommand to view the differences between the two files.

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

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

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