getSecure() public method

Gets whether responses to the server should be secure
public getSecure ( ) : boolean
return boolean
コード例 #1
0
ファイル: SqrlGenerate.php プロジェクト: trianglman/sqrl
 public function getUrl()
 {
     $url = ($this->configuration->getSecure() ? 's' : '') . 'qrl://' . $this->configuration->getDomain();
     if (strpos($this->configuration->getDomain(), '/') !== false) {
         $extension = strlen($this->configuration->getDomain()) - strpos($this->configuration->getDomain(), '/');
         $url .= substr($this->generateQry(), $extension) . '&d=' . $extension;
     } else {
         $url .= $this->generateQry();
     }
     return $url;
 }
コード例 #2
0
 public function testLoadsFullJsonConfig()
 {
     $obj = new SqrlConfiguration();
     $obj->load(__DIR__ . '/Resources/allOptional.json');
     $this->assertEquals(array(1), $obj->getAcceptedVersions());
     $this->assertEquals('otherdomain.com', $obj->getDomain());
     $this->assertEquals('sqrl.php', $obj->getAuthenticationPath());
     $this->assertEquals('My Example Server', $obj->getFriendlyName());
     $this->assertTrue($obj->getSecure());
     $this->assertTrue($obj->getAnonAllowed());
     $this->assertEquals(9, $obj->getNonceMaxAge());
     $this->assertEquals(250, $obj->getQrHeight());
     $this->assertEquals(5, $obj->getQrPadding());
     $this->assertEquals('gibberish data', $obj->getNonceSalt());
 }