2015-04-05 18:33:25 +05:30
|
|
|
<?php
|
|
|
|
namespace League\OAuth2\Server\Entities\Traits;
|
|
|
|
|
|
|
|
trait ClientEntityTrait
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $name;
|
|
|
|
|
|
|
|
/**
|
2016-02-18 16:18:23 +05:30
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $secret;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $redirectUri;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
2015-04-05 18:33:25 +05:30
|
|
|
*/
|
|
|
|
public function getName()
|
|
|
|
{
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-18 16:18:23 +05:30
|
|
|
* @inheritdoc
|
2015-04-05 18:33:25 +05:30
|
|
|
*/
|
|
|
|
public function setName($name)
|
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
}
|
2016-02-18 16:18:23 +05:30
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function canKeepASecret()
|
|
|
|
{
|
|
|
|
return $this->secret === null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setSecret($secret)
|
|
|
|
{
|
|
|
|
$this->secret = $secret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function validateSecret($submittedSecret)
|
|
|
|
{
|
|
|
|
return strcmp((string) $submittedSecret, $this->secret) === 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setRedirectUri($redirectUri)
|
|
|
|
{
|
|
|
|
$this->redirectUri = $redirectUri;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getRedirectUri()
|
|
|
|
{
|
|
|
|
return $this->redirectUri;
|
|
|
|
}
|
2016-01-20 15:06:16 +05:30
|
|
|
}
|