|
16 | 16 | use Neos\Flow\Annotations as Flow;
|
17 | 17 | use Neos\Flow\Core\Bootstrap;
|
18 | 18 | use Neos\Flow\Http\HttpRequestHandlerInterface;
|
| 19 | +use Neos\Flow\Log\Utility\LogEnvironment; |
19 | 20 | use Neos\Flow\Mvc\ActionRequest;
|
20 | 21 | use Neos\Flow\Mvc\Routing\Exception\MissingActionNameException;
|
21 | 22 | use Neos\Flow\Mvc\Routing\UriBuilder;
|
@@ -233,14 +234,14 @@ public function requestAccessToken(string $serviceName, string $clientId, string
|
233 | 234 | $this->entityManager->remove($existingAuthorization);
|
234 | 235 | $this->entityManager->flush();
|
235 | 236 |
|
236 |
| - $this->logger->info(sprintf('OAuth (%s): Removed old OAuth token for client "%s". (authorization id: %s)', $this->getServiceType(), $clientId, $authorizationId)); |
| 237 | + $this->logger->info(sprintf('OAuth (%s): Removed old OAuth token for client "%s". (authorization id: %s)', $this->getServiceType(), $clientId, $authorizationId), LogEnvironment::fromMethodName(__METHOD__)); |
237 | 238 | }
|
238 | 239 |
|
239 | 240 | $accessToken = $this->createOAuthProvider($clientId, $clientSecret)->getAccessToken(Authorization::GRANT_CLIENT_CREDENTIALS, $additionalParameters);
|
240 | 241 | $authorization = new Authorization($authorizationId, $serviceName, $clientId, Authorization::GRANT_CLIENT_CREDENTIALS, $scope);
|
241 | 242 | $authorization->setAccessToken($accessToken);
|
242 | 243 |
|
243 |
| - $this->logger->info(sprintf('OAuth (%s): Persisted new OAuth authorization %s for client "%s" with expiry time %s. (authorization id: %s)', $this->getServiceType(), $authorizationId, $clientId, $accessToken->getExpires(), $authorizationId)); |
| 244 | + $this->logger->info(sprintf('OAuth (%s): Persisted new OAuth authorization %s for client "%s" with expiry time %s. (authorization id: %s)', $this->getServiceType(), $authorizationId, $clientId, $accessToken->getExpires(), $authorizationId), LogEnvironment::fromMethodName(__METHOD__)); |
244 | 245 |
|
245 | 246 | $this->entityManager->persist($authorization);
|
246 | 247 | $this->entityManager->flush();
|
@@ -377,7 +378,7 @@ public function refreshAuthorization(string $authorizationId, string $clientId,
|
377 | 378 | try {
|
378 | 379 | $accessToken = $oAuthProvider->getAccessToken('refresh_token', ['refresh_token' => $authorization->refreshToken]);
|
379 | 380 | $authorization->accessToken = $accessToken->getToken();
|
380 |
| - $authorization->expires = ($accessToken->getExpires() ? \DateTimeImmutable::createFromFormat('U', $accessToken->getExpires()) : null); |
| 381 | + $authorization->setExpires($accessToken->getExpires() ? \DateTimeImmutable::createFromFormat('U', $accessToken->getExpires()) : null); |
381 | 382 |
|
382 | 383 | $this->logger->debug(sprintf($this->getServiceType() . ': New access token is "%s", refresh token is "%s".', $authorization->accessToken, $authorization->refreshToken));
|
383 | 384 |
|
|
0 commit comments