Janrain Integration

Viafoura integrates with many social network login providers (i.e. Facebook, Twitter, LinkedIn, etc), any OpenID Connect-compatible authentication provider system as well as Login Radius. Most integrations are as simple as copying and pasting the API key and secret code.

Janrain Integration
We currently support login integrations through Janrain's Backplane and OAuth authentication protocols.

Janrain OAuth
Janrain exposes a set of APIs and event handlers that allow Viafoura to integrate with their OAuth login flow. We use JavaScript API events handlers for the following Janrain events: onCaptureLoginSuccess, and onCaptureSessionEnded. In addition we monitor the LocalStorage key janrainCaptureToken for the currently active Access Token as a fallback mechanism.

These integration points allow us to react on both login, and logout actions from the Janrain system, and validate the end user's profile by fetching a small set of required fields, such as the UUID, and Display Name.

Please follow Janrain's documentation on how to integrate their authentication on your site.

Once the Janrain integration is working, you may enable Janrain login support in our administration area under Settings → Authentication Providers. Simply disable Viafoura email & social logins, enable the Janrain integration, and add the full endpoint URL (e.g.https://[CLIENT].us.janraincapture.com) to complete the setup process.

Janrain Backplane
Please follow Janrain's documentation on how to integrate their authentication on your site.

Create a Janrain capture app, and grant it the direct_read_access permission. Enable Backplane support in our administration area under Settings → Authentication Providers → Backplane v1.2 and copy the client_id and secret fields from your Janrain Capture Application settings.

Please make sure you have the following Janrain settings enabled:

<script type="text/javascript">
    janrain.settings.capture.backplane = true;
    janrain.settings.capture.backplaneBusName = 'YOUR_BUS_NAME';
    janrain.settings.capture.backplaneVersion = 1.2;
    janrain.settings.capture.backplaneBlock = 20;
    janrain.settings.capture.backplaneReplayOnPageLoad = true;
</script>

After you have enabled Backplane support, you may want to disable Viafoura's login, logout and account handling via widgets. You can do this through the administration area under Settings → Authentication.

Error Handling
Login errors will not be displayed to users by Viafoura. In order to be notified of login errors via JavaScript, you will need to subscribe to the Login Failure event.

Banned Users
Detecting a banned user as part of the login workflow is done through JavaScript on the page. Once Viafoura detects a login request (by detecting the Janrain login event), it will attempt to log the user into Viafoura, and if this fails Viafoura will publish a Login Failure event, containing the fact the user has been banned and the "Message to user" set by the moderator at the time of banning. You can find more information on how to detect and work with this event here.

Logout Events
Viafoura listens for Janrain logout events and automatically log users out of the Viafoura platform. This functionality will only work on pages that have included the Viafoura JavaScript; for best results, please ensure Viafoura's JavaScript is included in all pages where the user may log out.

📘

Note

The Backplane protocol does not guarantee that messages are received in order, and as a result login and logout events happening in quick succession may cause the user to remain logged into Viafoura despite being logged out of your site.

To work around this limitation, we recommend implementing a direct call to Viafoura's JavaScript when a user logs out of your site, to ensure the user is successfully logged out of Viafoura. For more information click here.


What’s Next