This API is used to obtain an id_token containing the active session's user data in JWS format . This id_token can then be transmitted between servers, enabling a partner to share a user's data among multiple sites/API keys. You can validate the JWT using the originating site's public key returned from accounts.getJWTPublicKey.
Note: This method is also supported in our REST API. If you wish to execute this method from your server, please refer toREST API > accounts.getJWT.
The following table lists the available parameters:
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.
|||fields||string||A comma separated list of fields from the user's Profile or Data objects to include in the JWT. By default only the user's UID is returned as the sub of the id_token.|
|||expiration||integer||The length of time the JWT will be valid, in seconds, from the time of the request.|
Attempting to call this method without a callback will not cause any errors. However, this method by itself only returns a response to the client and a callback is required to handle that data.
|apiVersion||integer||Defines the API version that returned the response.|
|id_token||string (JSON Web Token)||An id_token of the current user.|
|operation||string||The API that returned the response.|
|requestParams||JSON Object||An object consisting of the parameters sent in the original request that were injected by Gigya's Web SDK and the callback parameter.|