What are recommended best practices for reusing the OAuth token for the ExactTarget Fuel SDK?
On my website once I get a valid OAuth token, I cache it for 15 minutes and use that same token for all requests. Are there any possible pitfalls to this approach? My website is made up of two web servers. Is the authenticated token based on IP at all?
Instantiate ET_Client:
$params = array("clientid" => $this->getClientId(),
"clientsecret" => $this->getClientSecret(),
"xmlloc" => 'ExactTarget'.DS.'FuelSDK'.DS.'ExactTargetWSDL.xml' );
$this->_client = new ET_Client(false, false, $params);
Response Object: the instantiated ET_Client returns a tenantToken with a DateTime authTokenExpiration property that is 20 minutes from the request time.
["tenantTokens":"ET_Client":private]=>
array(1) {
[""]=>
array(4) {
["authToken"]=>
string(24) "..."
["authTokenExpiration"]=>
object(DateTime)#628 (3) {
["date"]=>
string(19) "2015-03-06 10:26:36"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["internalAuthToken"]=>
string(257) "..."
["refreshToken"]=>
string(24) "..."
}
}