mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
75 lines
1.6 KiB
PHP
75 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.4
|
|
*
|
|
* @package phpOMS\Auth\OAuth2
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link https://orange-management.org
|
|
* @see https://tools.ietf.org/html/rfc6749
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace phpOMS\Auth\OAuth2\Provider;
|
|
|
|
use phpOMS\Auth\OAuth2\AccessToken;
|
|
|
|
/**
|
|
* Provider class.
|
|
*
|
|
* @package phpOMS\Auth\OAuth2
|
|
* @license OMS License 1.0
|
|
* @link https://orange-management.org
|
|
* @since 1.0.0
|
|
*/
|
|
final class GeneralProvider
|
|
{
|
|
/**
|
|
* Authorization url
|
|
*
|
|
* @var string
|
|
* @since 1.0.0
|
|
*/
|
|
private string $urlAuthorize;
|
|
|
|
/**
|
|
* Access token url
|
|
*
|
|
* @var string
|
|
* @since 1.0.0
|
|
*/
|
|
private string $urlAccessToken;
|
|
|
|
public function __construct(array $options = [], array $collaborators = [])
|
|
{
|
|
}
|
|
|
|
public function getDefaultScopes() : array
|
|
{
|
|
return $this->scopes;
|
|
}
|
|
|
|
private function getAccessTokenMethod() : string
|
|
{
|
|
return $this->accessTokenMethod ?: parent::getAccessTokenMethod();
|
|
}
|
|
|
|
private function getAccessTokenResourceOwnerId() : string
|
|
{
|
|
return $this->accessTokenResourceOwnerId ?: parent::getAccessTokenResourceOwnerId();
|
|
}
|
|
|
|
private function getScopeSeparator() : string
|
|
{
|
|
return $this->scopeSeparator ?: parent::getScopeSeparator();
|
|
}
|
|
|
|
private function createResourceOwner(array $reesponse, AccessToken $token) : GeneralResourceOwner
|
|
{
|
|
return new GeneralResourceOwner($response, $this->responseResourceOwnerId);
|
|
}
|
|
}
|