Start by setting up a ClientConfig instance with your credentials:
use SSOfy\APIConfig;
...
$config = new APIConfig([
'domain' => 'api.us.ssofy.com', // api domain of your application
'key' => 'YOUR API KEY',
'secret' => 'YOUR APPLICATION SECRET',
'cache_store' => null, // cache driver to use. default: null
'cache_ttl' => 10800, // time-to-live in seconds. default: 60 * 60 * 3
'secure' => true, // use https connection. default: true
]);
It is highly recommended to specify a cache driver to enable the SDK to memorize verification results for a length of time in order to reduce response times.
You can kickstart with the built-in file-based cache driver. You might need to develop a custom implementation of the cache driver based on what works best for your application by implementing the SSOfy\Storage\CacheInterface
.
use SSOfy\Storage\FileStorage;
...
$cache = new FileStorage('/tmp/ssofy-cache');
// and refine your config settings to use the cache driver
// or use cache() chained method.
$config->cache($cache);