private static function verifySignatureFirebase($jwt) { $jwtCertsJSON = SessionCache::get(self::$JWT_CERTS_CACHE_KEY); if ($jwtCertsJSON === FALSE) { $jwtCertsJSON = HttpUtil::processRequest('https://www.googleapis.com/oauth2/v1/certs'); SessionCache::set(self::$JWT_CERTS_CACHE_KEY, $jwtCertsJSON); } $jwtCerts = json_decode($jwtCertsJSON, TRUE); return JWT::decode($jwt, $jwtCerts); }
private function getAccountIdByName($accountName) { $accountIdCacheKey = array('id' => 'ACCOUND_ID_FOR_' . strtolower($accountName), 'exp' => 3600); // 1 hour $accountId = SessionCache::get($accountIdCacheKey); if ($accountId == NULL) { $accountId = $this->getAccountIdByNameFromDB($accountName); SessionCache::set($accountIdCacheKey, $accountId); } return $accountId; }
private static function getOpenIDConfig($key) { $openIDConfigJSON = SessionCache::get(self::$OPENID_CONFIG_CACHE_KEY); if ($openIDConfigJSON == FALSE) { $openIDConfigJSON = HttpUtil::processRequest(self::OPENID_CONFIG_URL_KEY); SessionCache::set(self::$OPENID_CONFIG_CACHE_KEY, $openIDConfigJSON); } $openIDConfig = json_decode($openIDConfigJSON, TRUE); return $openIDConfig[$key]; }
/** * Define ou adicionar um valor na sessao Global. * * @param string $key * @param mixed $valor */ public function setGlobal($key, $valor) { SessionCache::set($this->globalKey($key), $valor); }