mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-16 02:03:16 +05:30
43 lines
778 B
PHP
43 lines
778 B
PHP
|
<?php
|
||
|
|
||
|
namespace OAuth2;
|
||
|
|
||
|
class Server
|
||
|
{
|
||
|
protected $scopeDelimeter = ',';
|
||
|
|
||
|
protected $expiresIn = 3600;
|
||
|
|
||
|
protected $responseTypes = array(
|
||
|
'code'
|
||
|
);
|
||
|
|
||
|
protected $storages = array();
|
||
|
|
||
|
protected $grantTypes = array();
|
||
|
|
||
|
public function __construct($storage)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
public function addGrantType(GrantTypeInterface $grant_type, $identifier = null)
|
||
|
{
|
||
|
if (is_null($identifier)) {
|
||
|
$identifier = $grant_type->getIdentifier();
|
||
|
}
|
||
|
$this->grantTypes[$identifier] = $grant_type;
|
||
|
}
|
||
|
|
||
|
public function setScopeDelimeter($scope_delimeter)
|
||
|
{
|
||
|
$this->scopeDelimeter = $scope_delimeter;
|
||
|
}
|
||
|
|
||
|
public function setExpiresIn($expires_in)
|
||
|
{
|
||
|
$this->expiresIn = $expires_in;
|
||
|
}
|
||
|
|
||
|
}
|