Login widget

The Login widget provides an interface designed to allow THRON authentication. This widget has two operating modes: in the first mode, whenever a user performs a successful login, the widget will automatically change its configuration, providing the logout interface; in the second mode, the widget will remain in its initial interface and each integrator will be responsible to manage operations after a successful login.

We suggest you to have a look at the Interactive Demo of the Widget Framework in order to have a look at the possibilities offered by this application.


Configuration parameters


  • clientId (string, mandatory): this is the domain name used to access your THRON service code.
  • appId (string, mandatory): id of the application which has been activated inside the Marketplace and which you are going to use to access content (you will find the id in the Management page in the application itself). This parameter is used to verify if the app is active and is a valid type
  • customCssClass (string, optional): this parameter is used to configure the suffix to be used by CSS classes within the widget, so you can have more widgets in the same page avoiding name collisions.
  • logoutSwitch (boolean, optional): This parameter is used to configure the widget’s operating mode. If true, after a successful login the widget will adapt its interface to enable a log‑out function, and it will provide all the information about the user logged in. If it is set to false no action will be performed after login. In case an already configured token is detected, the widget will be initiated with the logout interface. Default is true.
  • dictionaryLocale (string, optional): this parameter is used to set the language to be used by the widget’s interface, you can use the language codes provided by ISO 639-1 standard, “uppercase style” (e.g.: "EN", "IT"). If not configured the default will be "EN".
  • dictionaryName (string, optional): this parameter specifies the name of the dictionary to use for the widget, the language file for the widget must reference to this name for being used with the widget.


Functions that can be invoked on this widget


  • modifyLoginTemplate(html): this function allows you to configure the html code of the widget’s internal elements, so that you will be able to build a custom GUI. The variable is a string with the html code to be used by the widget for the login interface.
  • modifyLogoutTemplate(html): this function allows you to configure the html code of the widget’s internal elements, so that you will be able to build a custom GUI. The variable is a string with the html code to be used by the widget for the logout interface. In the logout template you can insert a placeholder which will be rendered as the name of the logged user by simply entering "[NICKNAME_COMPLETE]" in the point where you want to display the data, such as:


var LOGOUTTEMPLATE = '<div type="text" class="THRON-nickname-complete"/><NICKNAME_COMPLETE></div><a href="#" class="THRON-logout-button"></a>';




  • THRON.widget.event.LOG_STATUS_CHANGE: the event is launched every time a login/logout operation has been successfully carried out. The second parameter will be true when a login has been performed, it will be false when the user has logged out.


For example, in order to add the event to your player's instance you can just use the " .bind()" method; so if you have created your widget like this:

var loginWidget = new THRON.widgetLogin(loginWidgetParams);

then, in order to listen login-logout events you just have to do this:

loginWidget.bind(THRON.widget.event.LOG_STATUS_CHANGE, function(widget, data) {


  • Once the login has been successfully carried out via widget, in the global object THRON.widget.core.loggedUserData you can recover data used to log on; saved data are:
    • username
    • usertype
    • user full name

Such data will be saved in two cases:

  • if the logoutSwitch parameter is set to "true", hence after successfull login via widget.
  • if a user token has been configured within the widget's core. In this case the widget will check the token's validity and then retrieve user's data.
Was this article helpful?
0 out of 0 found this helpful

Have any question?

Open a ticket