Adding Single Sign-On

Single Sign-On is an authentication process that allows people access to multiple independent systems with a single login credential. ScribbleLive has some basic single sign on functionality built into every white label template.

Implementation: white label, legacy embed

Please note that code provided for these customizations is sample code used to modify Scribble from its out-of-the-box offerings. These are not supported features and ScribbleLive is not responsible for any future depreciation or changes we make to our platform that alter the functionality of the code within. For supported features and functionality, please see our Knowledge Base.

All you need to do is create a Javascript file that you host and include it in your white label template. You add it directly on the template page, or by appending the JS to the white label template in ScribbleLive.

<script type="text/javascript" src="http://yourserver.com/your_user_data.js"></script>

The file you create will contain something like this:

var ScribbleLive_SSO = { User: { Name: "Sample SSO User", Avatar: "http://YOURDOMAIN.COM/images/avatar10.png" }, };

Here’s some sample code that will help you with creating the yourserver.com/your_user_data.js file:

Scenario 1: A user is already logged in.

ScribbleLive_SSO =
 {
 User : { Name: "YOUR_USER'S_USER_NAME", Avatar: "http://YOURDOMAIN.COM/images/avatar10.png" }
 }

Scenario 2: A user is not logged in yet, let them login on a different page (your login page will then need to HTTP redirect the user back to the white-label page)

ScribbleLive_SSO =
 {
 LoginAction: "http://YOURDOMAIN.COM/login."
 }

Scenario 3: A user is not logged in yet, let them login via your Javascript

ScribbleLive_SSO =
 {
 LoginAction : JS_FUNCTION_TO_CALL_FOR_LOGIN
 OnLoginComplete : JS_FUNCTION_TO_CALL_AFTER_LOGIN
 }
function JS_FUNCTION_TO_CALL_FOR_LOGIN()
 {
 //your login code
 ScribbleLive_SSO.OnLoginComplete();
 }

Scenario 4: A user is logged in through your paywall or site

1. Copy this code into the top HTML section of your legacy embed in the ScribbleLive backend:

<script type="text/javascript">
 var data = location.search,
 matches = data.match(/\?.+\_\=username\|(.+)\|avatar_URL\|(.+)\|end/),
 ScribbleLive_SSO = { User: { Name: matches[1], Avatar: matches[2] } };
 </script>
<script type="text/javascript" src="http://embed.scribblelive.com/js/SSO.aspx">
 </script>

2. When loading the iframe embed on the page, the username and URL to avatar need to be replaced with your user’s name and URL to avatar:

iframe src='http://embed.scribblelive.com/Embed/v5.aspx?Id=80644&ThemeId=11076&_=username|username|avatar_URL|URL|end' width='550' height='600' frameborder='0' style='border: 1px solid #000'></iframe>
Advertisements