Not logged in - Login

  User Manual

  Tech Support

ServicePRO Web Login Integration for Webpages

Return to: ServicePRO Web - Login Screen

A PDF version of this documentation is available here.


Overview

This document will outline steps for hosting and implementing ServicePRO Web Login Integration on a corporate or support webpage. Additional details will be provided regarding setup and limitations of integrated login.

Setup Steps

1. Install ServicePRO Web on a working Web Server (IIS). Note the URL for using ServicePRO Web.
2. On the Web Server, browse to the directory containing ServicePRO Web’s application files.
3. Under this folder, browse to the Subdirectory ‘Views\Account’ – the following 2 files in the ‘Account’ folder will require updates:
  • Login.cshtml
  • _AccountFooterPartial.cshtml
    Before making changes, ensure backups of these 2 files are created.
    Open these files one at a time. Perform a Find & Replace action and replace all occurrences of http://unity.servicepro.com with your own ServicePRO Web URL (noted in Step 1).

4. In the Web.Config file for the ServicePRO Web Application (residing directly under the ServicePRO Web application’s main folder), the following should be displayed.

<httpProtocol>
      <customHeaders>
        <clear/>
        <add name="x-ua-compatible" value="IE=edge"/>
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Methods" value="GET, PUT, POST, DELETE, OPTIONS" />
        <add name="Access-Control-Allow-Headers" value="Content-Type, Content-Range, Content-Disposition, Content-Description, x-requested-with" />
      </customHeaders>
</httpProtocol>

Under the customHeaders section, add the new configuration key entries, replacing the lines below:
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Methods" value="GET, PUT, POST, DELETE, OPTIONS" />
        <add name="Access-Control-Allow-Headers" value="Content-Type, Content-Range, Content-Disposition, Content-Description, x-requested-with" />

5. On the corporate or support website page where you would like to integrate ServicePRO Web Login, add the following div section to where you want to plug in the ServicePRO Web login.

<div id="serviceprologin"></div>
6. Add the lines of code listed below into the header section in your web page.
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js"></script>
   <script type="text/javascript">
$(document).ready(function(e) {
         $.ajax({
              url: 'http://unity.servicepro.com/Account/Login?LoadWithoutLayout=true',
                  contentType: 'application/html; charset=utf-8',
              type: 'GET',
              dataType: 'html'
         })
         .success(function(result) {
              $('#serviceprologin').html(result);
          })
          .error(function(xhr, status) {
              document.getElementById("serviceprologin").innerHTML = "ServicePRO Web is under maintenance";
         });
        });
</script>

In addition, the two lines listed below should be edited based on the webpage featuring login integration:

    1. The following line is to be replaced with your ServicePRO Web URL:
    2. url: 'http://unity.servicepro.com/Account/Login?LoadWithoutLayout=true',
      
    3. This line displays a message for when the ServicePRO Web Login section is down for maintenance in the Web server where ServicePRO Web is hosted, OR when ServicePRO Web is being updated. The text can be customized to preference.
    4. document.getElementById("serviceprologin").innerHTML = "ServicePRO Web is under maintenance";
      

7. After all other steps are completed, clear the browser cache and reload the updated webpage in a browser. Verify that the login section loads properly and allows login to ServicePRO Web.

Limitations

  1. The operations listed below will take the user back to the standard login page for ServicePRO Web. It will not send them back to the corporate website page where the login was integrated.
    1.        Sign Out
    2.        Session Timeout
    3.        Selecting the ‘Forgot Password’ option in the Login section
    4.        New User Signup
  2. For integrated login, CAPTCHAs will not appear even if they are enabled in the Portal Designer settings. This is due to the session being lost when the CAPTCHA is posted.