Authentication - Saola Animate Document Integration

Hi toanls,

I was wondering if you can please recommend an approach to integrate an “authentication app” within a Saola Animate document. For example, the very first scene requests the user to be authenticated to be able to access the rest of the doc (rest of the scenes). I’ve been trying to use the HTML Widget, to call the external app. But I was looking for a better way to pass parameters from the external app to the Saola Animate document to condition access if the outcome (user authentication) is successful.

Thanks very much in advance for any guidance you can provide.

Javier

Hi Javier,

I’m sorry that I overlooked your question somehow. It’s the Lunar New Year holiday here in Viet Nam :slight_smile:

There might be several approaches to integrate an authentication application into a Saola Animate document, but it may depends on that application and require some coding.

So in my opinion, you should request the user to login before viewing the Saola Animate document. It’s simpler because it doesn’t require communication between the authentication application and the document.

Regards.

Hi Toan,

No worries, and congrats for the New Year’s celebration. Thanks for having the chance to provide guidance. It’s really appreciated.

Assuming the authentication app is used by users to get access to SA documents, would you suggest a special/specific way to manage parameters passed to those documents such as: session_id, user_id, etc.

Just want to hear from you on any suggestion to manage any type of parameter passed by external apps to Saola Animate docs.

Again, thanks a lot for your help and support.

Javier

Hi Javier,

Your question is quite general so I can’t suggest a suitable method to pass parameters from an external application to a SA document.
Basically you can use any method just JavaScript supports, e.g. the SA document sends an AJAX request to the application; the application stores parameters somewhere (e.g. JS variables, cookies, web storage) for the SA document to access; or the application postMessage to the SA document…

Please also notice the same-origin policy if the application and the SA document have different scheme/host/port tuple.

Let’s say a simple example: the external application is embedded into the SA document through a HTML Widget element, the application and the SA document have the same origin, the html page contains only one SA document. In this case the application can access the SA document by using the following JS code:

var theSADocument = window.parent.AtomiSaola.topDocs[0];

Once you got the SA document object, you can invoke its APIs or your custom scripts you defined within the document, e.g.

theSADocument.getElement('greeting').setText('Hello ' + userName);

Regards