Socialid.login.startConnect

(Difference between revisions)
Jump to: navigation, search
(Parameters)
(Description)
Line 4: Line 4:
  
 
The operation is similar to [[socialid.login.renderConnectWidget]], except for the fact that no widget will be rendered. The triggered events are the same as the widget.
 
The operation is similar to [[socialid.login.renderConnectWidget]], except for the fact that no widget will be rendered. The triggered events are the same as the widget.
 +
 +
<!--
 +
When the '''connectType''' is set to ''"event"'', this widget can trigger the following events:
 +
* [[socialid.events.onConnectStart]]
 +
* [[socialid.events.onConnectSuccess]]
 +
* [[socialid.events.onConnectCancel]]
 +
* [[socialid.events.onConnectError]]
 +
* [[socialid.events.onLoginSuccess]]
 +
* [[socialid.events.onDisconnectSuccess]]
 +
* [[socialid.events.onDisconnectError]]
 +
 +
This widget allows to add credentials from different social networks to the same Social Login user. For example, an user can log in with its Facebook and add its Twitter credential, so the next time this user can choose to log in with its Facebook or Twitter account and be referenced as the same user by the website integrating with the Social Login platform.
 +
 +
This widget works as follows:
 +
* if there is an user already logged in the current session, the new credential is added to the user account and the event [[socialid.events.onConnectSuccess]] is triggered.
 +
* if there is no user logged in the current session, a new login is created (same behavior as the [[socialid.login.renderLoginWidget|login widget]]) and the event [[socialid.events.onLoginSuccess]] is triggered.
 +
 +
In summary, it's important to handle these two events. In case of [[socialid.events.onLoginSuccess]] it's important to check the login token via server-side to certificate that the user logged in is the same associated to the current website session.
 +
-->
  
 
== Usage ==
 
== Usage ==

Revision as of 15:03, 23 November 2017

Contents

Description

Opens the popup dialog to connect a new provider credential in the current login session.

The operation is similar to socialid.login.renderConnectWidget, except for the fact that no widget will be rendered. The triggered events are the same as the widget.


Usage

 socialid.login.startConnect(provider)

Parameters

provider required Determines which provider will be used in the connect process. Can be "facebook", "twitter", "linkedin" or "gplus".

Example

It opens a popup starting the login dialog with Facebook when the user clicks on the "facebook_connect" button:

 socialid.login.init(1);
 facebook_button = document.getElementById("facebook_connect");
 facebook_button.onclick = function() {
   socialid.login.startConnect("facebook");
 };

You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox