Use Livefyre.js to add page-wide authentication for your Livefyre Apps.
Livefyre.js Aut
h is a JavaScript package developed by Livefyre that enables all the Apps on your website to share a single authentication integration. Auth allows you to define how your users should register, log in, and log out by delegating these flows to an AuthDelegate object that you define.
Use Livefyre.js
to enable authentication for a page in order to allow users to log in and interact with Apps using your existing authentication system.
To enable authentication on a page, add Livefyre.js
to the <head> element of your webpage or website template.
<script src="//cdn.livefyre.com/Livefyre.js"></script>
Use Livefyre.require
to enable authentication. Using Livefyre.require
is similar to using require to call other packages. The integration code to require auth looks like this:
Livefyre.require(['auth'], function (auth) { // Do authy things...});
To enable authentication create an AuthDelegate
and pass it to Livefyre.js
Authentication.
An AuthDelegate
is an object you define that determines how users will log in, log out, and view profiles.
Create an AuthDelegate
. The way you construct an AuthDelegate
depends on your identity provider. See Identity Integration for more detailed instructions.
Pass the AuthDelegate
to Livefyre.js
Authentication. The simplest AuthDelegate
logs the same user in whenever a user triggered the delegated login method from an App:
Livefyre.require(['auth'], function (auth) {
auth.delegate({
login: function (errback) {
errback(null, { livefyre: '<userAuthToken>' });
}
});
});
Synchronize the user profile information between Livefyre and your identity provider.
You must synchronize your user profile information between Livefyre and your Identity Provider. For more information, see Janrain Capture Integration.