10.4 Setting Up the B2C Login Page

When you integrate Access Manager with Self Service Password Reset, it automatically enables the Register and Forgot Password links on the login page. However, you can configure the login page based on your requirements. You can choose the options and actions that are available for users on the login page.

Perform the following steps to set up the B2C login page:

  1. Go to B2C Framework to download b2cFramework-1.0.zip. From Access Manager 4.4 Service Pack 1, the B2C Framework files are provided in the build and are available at /opt/novell/nids/lib/webapp/css/ folder of Access Manager Identity Server.

  2. Unzip b2cFramework-1.0.zip.

  3. Locate login_snippet.jsp and b2c_nam_login.jsp and copy these files to the /opt/novell/nids/lib/webapp/jsp/ folder of Access Manager Identity Server.

  4. Locate login_snippet.css and copy this file to the /opt/novell/nids/lib/webapp/css/ folder of Access Manager Identity Server.

  5. Locate example.html and example.css and rename these to index.html and index.css respectively.

  6. Open index.html and perform the following steps:

    1. Search for <link rel="stylesheet" href="example.css"> and replace example.css with index.css.

    2. Search for <script src="../login_snippet.js"></script> and replace /login_snippet.js with https://idp.b2c.com:8443/nidp/jsp/login_snippet.jsp.

    3. Search for apiHost: and replace https://prvqenam660.namdom049.lab:8443/ with https://idp.b2c.com:8443/.

    4. (Optional) In the login_snippet.jsp file, configure parameter loginUrl with the new login URL. For example, loginUrl: 'https://idp.b2c.com:8443/nidp/app/b2c_login'.

      IMPORTANT:This step is required only if the default authentication contract has two or more authentication methods configured. For example, if the default contract is a risk-based contract and it is configured to prompt for an additional authentication based on the risk, then configure this step.

  7. Save index.html.

  8. Host the index.html and index.css files on a web server or a Tomcat web application container. To host these files, create a folder named portal in the root folder of the web server or in the tomcat container and copy index.html and index.css files to this folder.

  9. Open the web.xml file located in Identity Server at /opt/novell/nam/idp/webapps/nidp/WEB-INF/.

  10. In the web.xml file, enable the CORS filter by uncommenting the following filter configuration:

    <filter>
                    <filter-name>CorsFilterController</filter-name>
                    <filter-class>com.novell.nidp.servlets.filters.CorsFilterController</filter-class>
            </filter>
            <filter-mapping>
                    <filter-name>CorsFilterController</filter-name>
                    <url-pattern>*</url-pattern>
            </filter-mapping>
            <filter>
                    <filter-name>CorsFilter</filter-name>
                    <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
            </filter>
            <filter-mapping>
                    <filter-name>CorsFilter</filter-name>
                    <url-pattern>*</url-pattern>
            </filter-mapping>
  11. Add the following:

    <servlet>
    
      <servlet-name>B2CLoginServlet
      </servlet-name>
    
      <display-name>B2C Login Servlet
      </display-name>
    
      <jsp-file>/jsp/b2c_nam_login.jsp
      </jsp-file>
    </servlet>
    
    <servlet-mapping>
      <servlet-name>B2CLoginServlet
      </servlet-name>
    
      <url-pattern>/app/b2c_login
      </url-pattern>
    
    </servlet-mapping>
  12. Add b2c_nam_login.jsp to the list of JSP in the param-value of the name>nidpJspFilter filter.

  13. Restart Identity Server.

  14. Ensure that you can access the B2C login page now at http(s)://<web server IP address where index.html is hosted>/portal/index.html and that the page contains a login form.

  15. For more customization options, locate Login Snippet.pdf in the files extracted from b2cFramework-1.0.zip. Open it to find further steps to customize the B2C login page.