1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ByTIC\Hello\Models\RefreshTokens; |
4
|
|
|
|
5
|
|
|
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface; |
6
|
|
|
use League\OAuth2\Server\Exception\UniqueTokenIdentifierConstraintViolationException; |
7
|
|
|
use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Class Tokens |
11
|
|
|
* @package ByTIC\Auth\Models\RefreshTokens |
12
|
|
|
* |
13
|
|
|
* @method RefreshToken getNew() |
14
|
|
|
*/ |
15
|
|
|
class RefreshTokens extends \Nip\Records\RecordManager implements RefreshTokenRepositoryInterface |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* Creates a new refresh token |
19
|
|
|
* |
20
|
|
|
* @return RefreshTokenEntityInterface |
21
|
|
|
*/ |
22
|
|
|
public function getNewRefreshToken() |
23
|
|
|
{ |
24
|
|
|
// TODO: Implement getNewRefreshToken() method. |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Create a new refresh token_name. |
29
|
|
|
* |
30
|
|
|
* @param RefreshTokenEntityInterface $refreshTokenEntity |
31
|
|
|
* |
32
|
|
|
* @throws UniqueTokenIdentifierConstraintViolationException |
33
|
|
|
*/ |
34
|
|
|
public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity) |
35
|
|
|
{ |
36
|
|
|
// TODO: Implement persistNewRefreshToken() method. |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Revoke the refresh token. |
41
|
|
|
* |
42
|
|
|
* @param string $tokenId |
43
|
|
|
*/ |
44
|
|
|
public function revokeRefreshToken($tokenId) |
45
|
|
|
{ |
46
|
|
|
// TODO: Implement revokeRefreshToken() method. |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Check if the refresh token has been revoked. |
51
|
|
|
* |
52
|
|
|
* @param string $tokenId |
53
|
|
|
* |
54
|
|
|
* @return bool Return true if this token has been revoked |
55
|
|
|
*/ |
56
|
|
|
public function isRefreshTokenRevoked($tokenId) |
57
|
|
|
{ |
58
|
|
|
// TODO: Implement isRefreshTokenRevoked() method. |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** @noinspection PhpMissingParentCallCommonInspection |
62
|
|
|
* @inheritDoc |
63
|
|
|
*/ |
64
|
|
|
protected function generateTable() |
65
|
|
|
{ |
66
|
|
|
return 'oauth_refresh_tokens'; |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|