Linking to our portal

It is possible to be able to provide your customers a seamless silent login experience to our portal if required and agreed with us. This could be to allow customers to quickly access one of our SaaS services from within your own platform without needing to enter credentials or perform some configuration of a channel.

Prerequisites

It is only possible to offer the silent login service if you can provide both the username and password for the user you want to login; typically this is possible as you provision and manage the users behind the scenes on behalf of your customer using the Reseller Services API described below.

Performing a Silent Login

Perform the following steps to complete a silent login to out portal:

Obtain the users session token

To perform a silent login you must obtain a session token (JWT) for you intended user via our Authenticate API. Simply pass the users credentials and a session token is returned in the form of a JWT.

Call silent login

The silent logon page is designed to accept a HTTPS POST with your user’s session token (JWT) and an optional path to where you would like to go within our portal after login.

The silent logon page URL is: https://portal-cpaas.dotdigital.com/silentLogOn

It accepts the POST data of type application/x-www-form-urlencoded , so please ensure the HTTP header for content type is set correctly e.g. Content-Type: application/x-www-form-urlencoded

The form variables required in the post are:


VariableDescriptionExample
tokenThe users session token (JWT)eyJleHAiOjE1NTU1
pathThe domain relative path you want to navigate to in the portal after login (optional)# /apiSpaces/

A basic example of a page that can use silent login is shown below; it is similar code you would launch in a tab or iframe to embed the portal in your products UI.
Note: Just insert your session token and required path in the code below between the {{ }}

<!DOCTYPE html>
<html>
  <head>
  	<title>Silent Login</title>
  </head>
  <body>
    <form action="https://portal-cpaas.dotdigital.com/silentLogOn" method="post" id="silentLogon">
      <input type="hidden" name="token" value="{{TOKEN}}" />
      <input type="hidden" name="path" value="{{PATH}}" />
    </form>
    <script type="text/javascript">
    window.onload = function () {
    document.forms["silentLogon"].submit();
    }
    </script>
  </body>
</html>