public static function setUpBeforeClass() { Castle::setApiKey('secretkey'); $_SERVER = array(); $_SERVER['HTTP_USER_AGENT'] = 'TestAgent'; $_SERVER['REMOTE_ADDR'] = '8.8.8.8'; }
public function exampleSessionTokenWithChallenge() { Castle::setApiKey('secretkey'); $jwt = new Castle_JWT(); $jwt->setHeader(array('iss' => '1', 'exp' => time())); $jwt->setBody('chg', 1); $jwt->setBody('dpr', 1); $jwt->setBody('mfa', 1); $jwt->setBody('vfy', 1); $jwt->setBody('typ', 'authenticator'); $jwt->isValid(); return array(array($jwt->toString())); }
public static function setUpBeforeClass() { Castle::setApiKey('secretkey'); }
/** * @expectedException Castle_ConfigurationError */ public function testConfiguration() { Castle::setApiKey(null); $this->request->send('GET', '/test'); }
public function setUp() { Castle::setApiKey('secret'); }
/** * Log out process: delete cookie, delete session */ public static function logout() { if (Config::get('CASTLE_ENABLED')) { Castle::setApiKey(Config::get('CASTLE_SECRET')); Castle::logout(); Castle::track(array('name' => '$logout.succeeded', 'user_id' => Session::get('user_id'))); } self::deleteCookie(); Session::destroy(); }