Gigya Job Openings

accounts.getJWT JS

Skip to end of metadata
Go to start of metadata

Description

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 to

 REST API > accounts.getJWT.

Syntax

 

Parameters

The following table lists the available parameters:

RequiredNameTypeDescription
callbackfunction
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.
fieldsstringA 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.
expirationintegerThe 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.

 

 

Response Data

FieldTypeDescription
apiVersionintegerDefines the API version that returned the response.
id_tokenstring (JSON Web Token)An id_token of the current user.
operationstringThe API that returned the response.
requestParamsJSON ObjectAn object consisting of the parameters sent in the original request that were injected by Gigya's Web SDK and the callback parameter.
errorCode integer The result code of the operation. Code '0' indicates success, any other number indicates failure. For a complete list of error codes, see the Response Codes and Errors table.
errorMessage string A short textual description of an error associated with the errorCode for logging purposes.
callId string Unique identifier of the transaction, for debugging purposes.
context object The context object passed by the application as a parameter to the API method, or null if no context object has been passed.

 

Response Example

{
	apiVersion:2
	callId:"7ab545b5e4cXXXXXXXXXX245763e1dda2e"
	context:undefined
	errorCode:0
	errorMessage:""
	id_token:"eyJ0eXAiOiJKV1QiXXXXXXXXXXI1NiIsImtleWlkIjoiUkVRME1VUTVOME5DUlRKRXXXXXXXXXXUmtORFEwVTBRME0xUkVGQlJqaERNXXXXXXXXXXIn0.eyJpc3XXXXXXXXXXvL2ZpZG0uZ2lneWEuY29tXXXXXXXXXXILS1Ic2FURmtvTUR2R0R2T2ZsU3RrWS1sWUt3UnRqMHVVYlXXXXXXXXXXFlPc1ZlR0lrZnctVGYvIiwiYXBpS2V5IjoiM19FbGxRSC0tSHNhVEZrb01XXXXXXXXXXtbFlLd1J0ajB1VWJYMWN1Y3F0dUlub1BZT3NWZUdJa2Z3LVRmIiwiaWF0IjoxNDkyMDE1MTAxLCJleHAiOjEXXXXXXXXXXmNjODFmNzQ1MmJiNmI0ZWRmODQzNXXXXXXXXXXn0.CV19O3VBJz4bdQ-ILqErXDGaBo36EzF5oo6-XXXXXXXXXX-Ivdfw9MhzVx3bJdWFGWLutJtfWjXXXXXXXXXX61dZ98m1LRs418Vo3jk8D_oNDEoLFMYiR5n11q3J38oF5kQXXXXXXXXXX_CYE-XXXXXXXXXX-Lmgaj5rAb9zWqxxBuQkkxaPqle_OqdXXXXXXXXXXP1JRXZBQ-J0FvuygkQ-766xJr-Fg-TQEwIg2DBVtv7tiO2cXs0O-KlbiIvQnq_3cMG9isaVYI9ALV-fHXXXXXXXXXX3hm8o_SVs3N2KOb6rxB-rS70Lg"
	ignoredFields:""
	operation:"/accounts.getJWT"
	requestParams:{
		APIKey:"3_EllQH--HsaXXXXXXXXXXtkY-lYKwRtj0uUbX1cuXXXXXXXXXXGIkfw-Tf"
		apiDomain:"us1.gigya.com"
		callback:(e)
		connectWithoutLoginBehavior:"loginExistingUser"
		customEventMap:Object
		defaultMobileRegScreenSet:"Default-RegistrationLogin"
		defaultRegScreenSet:"Default-RegistrationLogin"
		deviceType:"auto"
		enabledProviders:"*"
		lang:"en"
		rememberSessionExpiration:0
		sessionExpiration:0
	}
	status:"OK"
	statusMessage:""
	time:"2017-04-12T16:38:21.535Z"
}

 

Additional Information

How To Validate A Gigya id_token

 

 

 

 

  • No labels