1 | <?php |
||
14 | class AccessTokenService implements AccessTokenServiceInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var AccessTokenRepositoryInterface |
||
18 | */ |
||
19 | private $accessTokenRepository; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $accessTokenClass; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $defaultExpirationDuration = '+1 month'; |
||
30 | |||
31 | /** |
||
32 | * @var AuthenticationManagerInterface |
||
33 | */ |
||
34 | private $authenticationManager; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | private $authenticationProviderKey; |
||
40 | |||
41 | 16 | public function __construct( |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 4 | public function findByToken(string $token): ?AccessToken |
|
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 2 | public function createAccessToken(string $username, string $password): AccessToken |
|
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | 2 | public function findUserByToken(string $token): ?UserInterface |
|
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | 6 | public function listByUser(UserInterface $user): array |
|
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | 2 | public function createAccessTokenForUser(UserInterface $user): AccessToken |
|
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | 2 | public function cleanUpExpiredTokens(): int |
|
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | 2 | public function remove(AccessToken $accessToken) |
|
126 | |||
127 | /** |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getDefaultExpirationDuration() |
||
134 | |||
135 | /** |
||
136 | * @param string $defaultExpirationDuration |
||
137 | */ |
||
138 | public function setDefaultExpirationDuration($defaultExpirationDuration) |
||
142 | } |
||
143 |