1 | <?php |
||
22 | trait AccessTokenAuthorizationTrait |
||
23 | { |
||
24 | use AccessTokenTrait; |
||
25 | |||
26 | /** |
||
27 | * @param RequestInterface $request |
||
28 | * @return RequestInterface |
||
29 | * @throws \yii\base\InvalidConfigException |
||
30 | */ |
||
31 | public function prepareAuthorizationRequest( |
||
36 | |||
37 | /** |
||
38 | * @param RequestInterface $request |
||
39 | * @return RequestInterface |
||
40 | * @throws \yii\base\InvalidConfigException |
||
41 | */ |
||
42 | protected function addAuthorizationHeader(RequestInterface $request): RequestInterface |
||
49 | |||
50 | /** |
||
51 | * @param ResponseInterface $response |
||
52 | * @param RequestInterface $request |
||
53 | * @param callable $runner |
||
54 | * @return ResponseInterface |
||
55 | * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException |
||
56 | * @throws \flipbox\craft\ember\exceptions\RecordNotFoundException |
||
57 | * @throws \yii\base\InvalidConfigException |
||
58 | */ |
||
59 | public function handleAuthorizationResponse( |
||
75 | |||
76 | /** |
||
77 | * @param ResponseInterface $response |
||
78 | * @return bool |
||
79 | */ |
||
80 | protected function responseIsExpiredToken(ResponseInterface $response): bool |
||
92 | |||
93 | /** |
||
94 | * @param RequestInterface $request |
||
95 | * @param ResponseInterface $response |
||
96 | * @param callable|null $next |
||
97 | * @return mixed |
||
98 | * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException |
||
99 | * @throws \flipbox\craft\ember\exceptions\RecordNotFoundException |
||
100 | * @throws \yii\base\InvalidConfigException |
||
101 | */ |
||
102 | protected function refreshAndRetry(RequestInterface $request, ResponseInterface $response, callable $next = null) |
||
120 | |||
121 | /** |
||
122 | * @param AccessTokenInterface $accessToken |
||
123 | * @param AccessTokenInterface $refreshToken |
||
124 | * @return bool |
||
125 | * @throws \flipbox\craft\ember\exceptions\RecordNotFoundException |
||
126 | */ |
||
127 | protected function saveRefreshToken(AccessTokenInterface $accessToken, AccessTokenInterface $refreshToken): bool |
||
135 | } |
||
136 |