/
GrantStrategyInterface.php
58 lines (51 loc) · 1.63 KB
/
GrantStrategyInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* @author AlloVince
* @copyright Copyright (c) 2015 EvaEngine Team (https://github.com/EvaEngine)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Eva\EvaOAuth\OAuth2\GrantStrategy;
use Doctrine\Common\Cache\Cache;
use Eva\EvaOAuth\OAuth2\AuthorizationServerInterface;
use Eva\EvaOAuth\OAuth2\ResourceServerInterface;
use GuzzleHttp\Client as HttpClient;
use Eva\EvaOAuth\Token\AccessTokenInterface;
use GuzzleHttp\Event\EmitterInterface;
/**
* Interface GrantStrategyInterface
* @package Eva\EvaOAuth\OAuth2\GrantStrategy
*/
interface GrantStrategyInterface
{
/**
* @return EmitterInterface
*/
public function getEmitter();
/**
* Generate OAuth authorize URL with query
*
* @param AuthorizationServerInterface $authServer
* @return string
*/
public function getAuthorizeUrl(AuthorizationServerInterface $authServer);
/**
* Redirect to authorize url (Maybe do nothing under some grant types)
*
* @param AuthorizationServerInterface $authServer
* @param string $url
* @return void
*/
public function requestAuthorize(AuthorizationServerInterface $authServer, $url = '');
/**
* @param ResourceServerInterface $resourceServer
* @param array $urlQuery
* @return AccessTokenInterface
*/
public function getAccessToken(ResourceServerInterface $resourceServer, array $urlQuery = array());
/**
* @param HttpClient $httpClient
* @param array $options
* @param Cache $storage
*/
public function __construct(HttpClient $httpClient, array $options, Cache $storage = null);
}