Sun OpenSSO Enterprise 8.0 Integration Guide

Creating a Custom ChangePassword.jsp File

By default, the user is directed to the OpenSSO Enterprise password change page. Create a custom JSP file, ChangePassword.jsp, that redirects a user to Identity Manager for password change events. The new ChangePassword.jsp forwards the following information to Identity Manager:

This customized ChangePassword.jsp file is referenced in the section Modifying the LDAP Authentication Module XML Service File.

To create a custom ChangePassword.jsp file, choose only one of the following procedures:

ProcedureTo Create a New ChangePassword.jsp File

  1. Create the file config/auth/default/ChangePassword.jsp in the OpenSSO Enterprise web-app directory.


    Example:

    <html>
    
    <%@page info="Login" language="java"%>
    <%@taglib uri="/WEB-INF/jato.tld" prefix="jato"%>
    <%@taglib uri="/WEB-INF/auth.tld" prefix="auth"%>
    <jato:useViewBean className="com.sun.identity.authentication.UI.LoginViewBean">
    
    
    <%@ page contentType="text/html" %>
    
    <head>
    <title><jato:text name="htmlTitle_Login" /></title>
    
    <%
    String ServiceURI = (String) viewBean.getDisplayFieldValue(viewBean.SERVICE_URI);
    %>
    
    <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>
    </head>
    
    <%
        System.out.println("AccountId: " + request.getParameter("IDToken1"));
        System.out.println("goto: " + request.getParameter("goto"));
            System.out.println("plaingoto: " + request.getParameter("plaingoto"));
    
        String accountId = request.getParameter("IDToken1");
        String gotoURL = request.getParameter("plaingoto");
    
        String redirectURL = 
            "http://HostName.DomainName:6480/idm/authutil/anonResetPassword.jsp";
    if(accountId != null){
            redirectURL = redirectURL + "?accountId=" + accountId;
            }        
    if(gotoURL != null && !gotoURL.equals("null") && (gotoURL.length() > 0)){
            if(accountId == null){
                redirectURL = redirectURL + "?goto=" + gotoURL;
                    }else{
                redirectURL = redirectURL + "&goto=" + gotoURL;
                    }
            }
        System.out.println("Redirect URL is:" + redirectURL);
            response.sendRedirect(redirectURL);
    %>
    
    </jato:useViewBean>
    
    </html>
  2. Customize the URL to the Identity Manager page that performs the password-reset functions.

    The URL is highlighted in bold above. Determine this URL with help from your Identity Manager administrator, and customize the URL for your deployment.

ProcedureTo Use the Sample Source Code

  1. Copy the sample file opensso/integrations/idm/jsps/ChangePassword.jsp in the opensso.zip distribution to the directory web-container-deploy-base/opensso/config/auth/default.

  2. Customize the URL to the Identity Manager page that performs the password-reset functions.

    Determine this URL with help from your Identity Manager administrator, and customize the URL for your deployment. See step 2 of Creating a Custom ChangePassword.jsp File .