Returns the session information required for making direct API calls to the providers. This allows you to retrieve information or perform operations that are not yet supported by the Gigya service.
Each provider requires its own different set of fields for making direct API call. Specify the provider for which to retrieve the session information in the method's input parameter. Only the fields that are required by the specified provider are available in the Response Object.
If the call is made over HTTP, some sensitive fields are encrypted to prevent them from being used by unauthorized parties.
The encryption is performed using the AES algorithm, where the key is your partner "Secret Key" and the initialization vector is passed as a field in the Response Object. Your partner "Secret Key" is provided at the bottom of the Site setup page on the Gigya website (make sure you have logged in to Gigya's website and completed the Gigya Setup process). The "Secret key" is provided in base64 encoding and must be converted into a binary array before it can be used (most development environments include a method that implements this). Additional settings for the AES algorithm:
- Cypher mode - CBC
- Padding mode - you may select the padding mode to be used by setting the paddingMode optional parameter (see the Params table below), with one of the following optional values: 'PKCS5', 'PKCS7' or 'ZEROS' (PKCS7 is the default).
Note: This method is also supported in our REST API. If you wish to execute this method from your server, please refer toREST API > socialize.getSessionInfo.
The following providers currently support this operation:
The following table lists the available parameters:
The provider for which to retrieve the session information. The optional values for this parameter are:
facebook, twitter, google, linkedin, yahoo, microsoft, foursquare, renren, qq, sina, vkontakte, mixi, yahoojapan, spiceworks, odnoklassniki, amazon, xing, wechat, wordpress, blogger, paypaloauth, netlog, line, livedoor, aol, and orangefr (Note: messenger has been replaced by microsoft, however, for backward compatibility, either can be used).
You can also pass the name of a SAML or OIDC provider, as you have defined it in the console, e.g.,
A reference to a callback function. Gigya calls the specified function along with the results of the API method when the API method completes.
The callback function should be defined with the following signature: functionName(Response).
The "Response Object Data Members" table below provides specification of the data that is passed to the callback function.
A string of maximum 100 characters length. The CID sets categories for transactions that can be used later for filtering reports generated by Gigya in the "Context ID" combo box. The CID allows you to associate the report information with your own internal data. For example, to identify a specific widget or page on your site/application. You should not define more than 100 different context IDs.
A developer-created object that is passed back unchanged to the application as one of the fields in the response object.
|||paddingMode||string||The padding mode to be used in the AES algorithm. The valid values for this parameter are: 'PKCS5', 'PKCS7' and 'ZEROS'. The default value, if this parameter is not set, is 'PKCS7'.|
|||encrypt||Boolean||Determines whether the values of the tokenSecret and sessionHandle response fields should be encrypted. The default value of this parameter differs between HTTP and HTTPS. If the call is made over HTTPS, the default value of the encrypt parameter is 'false', that is, the fields are not encrypted by default. If the call is made over HTTP, the default value of the encrypt parameter is 'true', that is, the fields are encrypted by default.|
|||signIDs||Boolean||The default value is "false". If this field is set to "true", the timestamp and providerUIDSig fields are returned and the providerUID that is returned by this method will be signed by Gigya. To learn more about this subject, please refer to the Security page of the Developer's Guide.|
Response Object Data Members
|authToken||string||The session authentication token. See in the table below, how this field is mapped to the corresponding field in each provider.|
|tokenSecret||string||The session token secret encoded in BASE64. The value of this field is encrypted with the partner secret key unless you have set the encrypt parameter to 'false' (see explanation above). See in the table below, how this field is mapped to the corresponding field in each provider.|
|tokenExpiration||string||The expiration time for the session token. See in the table below, how this field is mapped to the corresponding field in each provider. Note that when socialize.notifyLogin is used to establish a session, the tokenExpiration value contains the tokenExpiration passed to socialize.notifyLogin.|
|sessionHandle||string||The session handle encoded in BASE64. The value of this field is encrypted with the partner secret key unless you have set the encrypt parameter to 'false' (see explanation above). See in the table below, how this field is mapped to the corresponding field in each provider.|
|sessionExpiration||string||The session expiration time. See in the table below, how this field is mapped to the corresponding field in each provider.|
|IV||string||The initialization vector that should be used for decrypting the encrypted fields, encoded in BASE64.|
|providerUID||string||The person's ID on the connected provider.|
|timestamp||string||The GMT time of the signature in UNIX time format (i.e., the number of seconds since Jan. 1st 1970). This field is returned only if signIDs is set to "true".|
|providerUIDSig||string||The signature on timestamp_providerUID. This field is returned only if signIDs is set to "true".|
The following table shows how our response field names map to the respective providers expected session field names.
|Field||Twitter / Google+ / Yahoo||Foursquare / Microsoft / Mixi / QQ / Renren / Sina / VKontakte|
|sessionHandle||-||oauth_session_handle (if supported)||refresh_token (if supported)|
|sessionExpiration||-||oauth_authorization_expires_in (if supported)||-|