1 | <?php |
||
13 | class AuthorizationServerConfigurationBuilder |
||
14 | { |
||
15 | private $defaultOptions = [ |
||
16 | 'client_storage' => null, |
||
17 | 'access_token_storage' => null, |
||
18 | 'refresh_token_storage' => null, |
||
19 | 'access_token_generator' => null, |
||
20 | 'always_require_a_client' => false, |
||
21 | 'access_token_length' => 32, |
||
22 | 'access_token_ttl' => 3600, |
||
23 | 'always_generate_a_refresh_token' => false, |
||
24 | 'grant_types' => [] |
||
25 | ]; |
||
26 | |||
27 | private $options = [ |
||
28 | 'client_storage' => null, |
||
29 | 'access_token_storage' => null, |
||
30 | 'refresh_token_storage' => null, |
||
31 | 'access_token_generator' => null, |
||
32 | 'always_require_a_client' => false, |
||
33 | 'access_token_length' => 32, |
||
34 | 'access_token_ttl' => 3600, |
||
35 | 'always_generate_a_refresh_token' => false, |
||
36 | 'grant_types' => [] |
||
37 | ]; |
||
38 | |||
39 | private $built = false; |
||
40 | |||
41 | private $configuration; |
||
42 | |||
43 | public function __construct() |
||
46 | |||
47 | public function setClientStorage(ClientStorage $clientStorage) |
||
53 | |||
54 | public function setAccessTokenStorage(AccessTokenStorage $clientStorage) |
||
60 | |||
61 | public function setRefreshStorage(RefreshTokenStorage $clientStorage) |
||
67 | |||
68 | public function alwaysRequireAClient($flag) |
||
74 | |||
75 | public function alwaysGenerateARefreshToken($flag) |
||
81 | |||
82 | public function setAccessTokenTTL($ttlInSeconds) |
||
89 | |||
90 | public function setAccessTokenGenerator($accessTokenGenerator) |
||
96 | |||
97 | public function addGrantType(GrantType $grantType, $overrideExisting = false) |
||
111 | |||
112 | public function build() |
||
145 | |||
146 | public function reset() |
||
152 | |||
153 | public function getAuthorizationServerConfiguration() |
||
162 | } |
||
163 |