Cinema8 Interactive Video - Authentication & SSO for Video single signon

Authentication & SSO

By Default Cinema8 Interactive Videos play as anonymous in all platfoms. In this case you can track your users anonymously and all interactions collected by the systems will be tagged as anonymous.

To track certain users who has already signed in to one of your systems (This can be any intranet , extranet , mobile app or LMS systems) ,you can use Cinema8 REST APIs to generate an "on behalf of" auth token for your users.

You can use the "Login As with Username" method in C8 REST API. After exposing this API and generated an "on behalf of" token for your users , pass this token to any web service call or use this token with JS API to track your signed in users.

Method: POST
Url: https://cinema8.com/api/v1/authenticate/loginAsWithUsername/bearer
Header: Content-Type: application / x-www-form-urlencoded
Payload
token: {Auth-TOKEN}  (this is the base64 admin key generated from 
Generating API key for integrations)
username: account-name \ username

Here you need to send username information with your account name to the service.
as in the above example, accountname \ [username].

API returns 200 status code with the generated auth token. Generated auth token is valid for 6 hour , after 6 hour the token will be invalid and you need to generate a new token for your users. If you want, you can simply put the tokens on a 6-hour expirable map.
You can use the token from this map  in a valid way for at least 6 hours.

In case the user is not in the system, 401 status code will be returned. Indicates that there is no [user.name] user in the system, You can also create the user before trying to generate the token for unregistered users. See the Cinema8 REST API to register users on the system.

A sample usage of "on behalf of" token in player 


  1. <script >
        // Setup
        var player = new Cinema8Player("#video", {
            id: "rJVZ6nJg",
            authToken: "751963c10652935de6b94670de98833c430dc83c",  
             // token generated with loginAsWithUsername

            onReady: function() {
                //console.log("onready fired");
            },
            onPlay: function() {
                //console.log("onplay fired");
            },
            onPause: function() {
                //console.log("onpause fired");
            },
            onProgress: function() {
                //console.log("onprogress fired");
            },
            onEnd: function() {
                //console.log("onend fired");
            },
            onCustomCallback: function(param) {
                console.log(param);
            },
            onWebhookResponse: function(response) {
                console.log(response);
            }
        });
    }); </script>


    • Related Articles

    • Studio Development - Using Variables

      Cinema8 creative studio allows you to develop video interactions without writing code with drag-and-drop tools, You can still create variables in the video, fill these variables from integrations or widgets you have developed, and build algorithms ...
    • Getting started with C8 API

      Cinema8 APIs to build extensive digital experiences within your videos. Cinema8 has an extensive API to support your business and your customers’ needs while developing interactive video-based solutions. Whether you are developing a web application, ...
    • Generating API key for integrations

      Get an API Key New Users: Before you can start using the Cinema8 Platform APIs and SDKs, you must sign up and create a billing account. To learn more, see Get Started with Cinema8 Platform . Cinema8 supports OAuth specification to authorize API ...
    • WebSocket API

      WebSocket powered widget development The WebSocket api within Cinema8 widget development environment allows you to create real-time communication and collaboration tools for your interactive videos. By leveraging websockets, you can create ...
    • Working with video URL parameters

      You can customize interactive videos with parameters you pass to Cinema8 video urls. Check out this video to see a running example of how you can configure a video with url parameters. https://cinema8.com/video/ADQrr9X6?sub=en&t=s10&autoplay=1 This ...