Socialid.login.startLogin
From Social ID Developers
Revision as of 13:11, 4 November 2014 by Renato.neves (Talk | contribs)
Contents |
Description
Starts the social login process for the given provider. It could open a popup dialog or redirect to the provider, depending on the loginType.
This method can trigger the following events:
- socialid.events.onLoginStart
- socialid.events.onLoginSuccess
- socialid.events.onLoginCancel
- socialid.events.onLoginError
Usage
socialid.login.startLogin(provider)
Parameters
provider | required | Determines which provider will be used in the login 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_login" button:
socialid.login.init(1, {loginType: "event"}); facebook_button = document.getElementById("facebook_login"); facebook_button.onclick = function() { socialid.login.startLogin("facebook"); };
You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground