LoginRadius Integration
Login Radius is a company that provides authentication solutions and helps companies manage user data. Viafoura has implemented a direct integration to allow you to quickly connect your LoginRadius Authentication with Viafoura.
Steps to Configure
- Go to Login Radius admin: https://adminconsole.loginradius.com/ For Viafoura Accounts you should use the “Cloud Identity Account Manager” extension to Login
- Get the API credentials: Platform Security > API Credentials > Account Keys
- Go to Viafoura Admin: https://admin.viafoura.co and set the API credentials and app name: Site Settings > Authentication > Login Radius

The “Enable embedded LoginRadius forms“ toggle enables Login Radius forms in our login Tray widget. If it is off, you will need to implement the login interface on your side and use JavaScript API to log in users.
Login Function
You will need to call the login function below with the users token after they authenticate with LoginRadius to log the user into Viafoura. Viafoura will call the LoginRadius Account API endpoint to get user details.
window.vf.session.login.loginRadius("token")
Login Events
A logged out user clicks on login in your system. You log the user in using your current login provider.
Viafoura's user interface includes several triggers to the authentication process. For example, any action that requires the user to be logged in (posting or liking a comment, following a user or a conversation, etc.) is meant to trigger Viafoura's default log in workflow if the user is not logged in.
We recommend that you intercept the default Viafoura login workflow to trigger your custom authentication. The code snippet below is an example of how you can achieve this:
// Make vfQ available or use existing one if already loaded
window.vfQ = window.vfQ || [];
window.vfQ.push(() => {
// viafoura is loaded and window.vf is available
window.vf.$prepublish((channel, event, ...args) => {
if (channel === 'authentication' && event === 'required') {
window.vf.$publish("tray", "close");
// add here the handler to trigger your authentication login flow
return false;
}
else {
return { channel, event, args };
}
});
});
Logout
If the user clicks on a "logout" call to action in your authentication system, or their session expires, ensure that a call is made to the following JavaScript promise to destroy the Viafoura session.
This promise needs to be awaited in a then block or with await, depending on your implementation.
window.vf.session.logout();
You should also ensure that if the user logs out of Viafoura, that action is passed to your authentication system to complete the user logout:
Javascript Snippet to Complete Logout
window.vf.$subscribe('authentication', 'logout', () => {
// add here the handler to trigger your authentication logout flow
});
Display Name Priority:
We have 4 ways to set the users display name (name shown when a user comments):
- If there is a custom field for username configured in the site settings (Authentication/Login Radius/Username Map). If value returned by client is blank, an error is produced. 500 - heimdall exception - invalid name
- profileName (if exists AND custom field for username is not configured)
- full name (if profileName does not exist AND custom field for username is not configured)
- “Default User“ is displayed if no custom field for username configured in the site settings AND the clients LoginRadius instance is not storing a First and Last name
API Endpoint
We call this endpoint to get the logged in users uid and displayname: https://api.loginradius.com/identity/v2/auth/account
Bearer <ACCESS_TOKEN> (User's access token) is passed in the header to authenticate the API request.
Read all Profiles by Token | Identity Platform Documentation
Updated 9 days ago