Socialid.login.init

(Difference between revisions)
Jump to: navigation, search
(Parameters)
(Description)
Line 1: Line 1:
 
== Description ==
 
== Description ==
  
Inicializa a API para ser usada por uma aplicação do social login. É obrigatório chamar esta função antes de usar qualquer recurso da API do Social Login.
+
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.
 +
* 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 Javascript 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 ==
 
== Usage ==

Revision as of 13:52, 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.
  • 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 Javascript 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 obrigatório o identificador numérico da aplicação do social login
options opcional um objeto contendo parâmetros adicionais
loginType opcional Pode ser "callback" ou "event". Especifica se após um onLoginSuccess a página será redirecionada automaticamente para o callback_url ("callback") ou se apenas o evento será gerado ("event"). 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