Socialid.login.startLogin
(Difference between revisions)
(→Usage) |
(→Parameters) |
||
Line 19: | Line 19: | ||
| width="200px" | required | | width="200px" | required | ||
| Determines which provider will be used in the login process. Can be "facebook", "twitter", "linkedin" or "gplus". | | Determines which provider will be used in the login process. Can be "facebook", "twitter", "linkedin" or "gplus". | ||
+ | |+ | ||
+ | ! align="left" width="200px" | options | ||
+ | | width="200px" | optional | ||
+ | | A Javascript object containing additional parameters. | ||
+ | |+ | ||
+ | ! align="left" width="200px" style="padding-left: 20px" | redirectURI | ||
+ | | width="200px" | optional | ||
+ | | Overrides [[socialid.login.init|loginRedirectURI]] parameter | ||
+ | |+ | ||
+ | ! align="left" width="200px" style="padding-left: 20px" | scope | ||
+ | | width="200px" | optional | ||
+ | | Overrides [[socialid.login.init|scope]] parameter | ||
|} | |} | ||
Revision as of 15:34, 23 November 2017
Contents |
Description
Starts the social login process for the given provider. Can open a popup dialog or redirect to the provider, depending on the loginType.
When the loginType is set to "event", this method can trigger the following events:
- socialid.events.onLoginStart
- socialid.events.onLoginSuccess
- socialid.events.onLoginCancel
- socialid.events.onLoginError
Usage
socialid.login.startLogin(provider, options)
Parameters
provider | required | Determines which provider will be used in the login process. Can be "facebook", "twitter", "linkedin" or "gplus". | options | optional | A Javascript object containing additional parameters. | redirectURI | optional | Overrides loginRedirectURI parameter | scope | optional | Overrides scope parameter |
---|
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