Socialid.login.init

(Difference between revisions)
Jump to: navigation, search
(Description)
(Parameters)
Line 17: Line 17:
 
{|
 
{|
 
! align="left" width="200px" | appId
 
! align="left" width="200px" | appId
| width="200px" | obrigatório
+
| width="200px" | required
| o identificador numérico da aplicação do social login
+
| The identifier number of the Social Login application.
 
|+
 
|+
 
! align="left" width="200px" | options
 
! align="left" width="200px" | options
| width="200px" | opcional
+
| width="200px" | optional
| um objeto contendo parâmetros adicionais
+
| A Javascript object containing additional parameters.
 
|+
 
|+
 
! align="left" width="200px" style="padding-left: 20px" | loginType
 
! align="left" width="200px" style="padding-left: 20px" | loginType
| width="200px" | opcional
+
| width="200px" | optional
| Pode ser "callback", "event" or "redirect". Default: "event".
+
| Define how the Social Login will be performed in the browser (see the description above). It could be "callback", "event" or "redirect". Default: "event".
 
|}
 
|}
  

Revision as of 15:44, 31 October 2014

Contents

Description

Initializes the API to be used by a Social Login application. It's required to call this function to unlock the other Social Login APIs.

This function takes an important option: the loginType. This option controls how the Social Login flow is executed in the browser. You can configure the loginType with one of these values:

  • event: the Social Login is performed in a popup and all the steps generate Javascript events. The browser is not redirect to any location, you should handle the login success through socialid.events.onLoginSuccess.
  • callback: the Social Login is performed in a popup and at the end of the process the web page is redirected to the callback url configured in the Social Login dashboard. Intermediate login events are generated.
  • redirect: the Social Login is performed via redirects in the following order: website > socialid > social network > socialid > website callback. Popup is not used in this case. This option is useful for places where the browser is limited and cannot use popups.

Usage

 socialid.login.init(appId, options)

Parameters

appId required The identifier number of the Social Login application.
options optional A Javascript object containing additional parameters.
loginType optional Define how the Social Login will be performed in the browser (see the description above). It could be "callback", "event" or "redirect". Default: "event".

Example

Inicializando a API do Social Login para user usado pela aplicação de id "1" e gerando eventos a serem tratados por Javascript ("event"), sem redirecionar automaticamente para o callback_url cadastrado na aplicação:

 socialid.login.init(1, {loginType: "event"});

Teste os parâmetros em nosso playground: https://sid-examples.herokuapp.com/social_logins/playground

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox