fix: log authorization denials on the auth channel
This commit is contained in:
1 parent
aebfc2ca9b
commit
46934e278c
1 file changed
+3
-3
@@ -39,7 +39,7 @@ class AuthorizationCodeListener
|
|||||||
private readonly UrlGeneratorInterface $urlGenerator,
|
private readonly UrlGeneratorInterface $urlGenerator,
|
||||||
private readonly RequestStack $requestStack,
|
private readonly RequestStack $requestStack,
|
||||||
private readonly Security $security,
|
private readonly Security $security,
|
||||||
private readonly LoggerInterface $authenticationLogger,
|
private readonly LoggerInterface $authLogger,
|
||||||
private readonly Environment $twig,
|
private readonly Environment $twig,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ class AuthorizationCodeListener
|
|||||||
Response::HTTP_TEMPORARY_REDIRECT
|
Response::HTTP_TEMPORARY_REDIRECT
|
||||||
);
|
);
|
||||||
$event->setResponse($response);
|
$event->setResponse($response);
|
||||||
$this->authenticationLogger->info('Authorization request without session');
|
$this->authLogger->info('Authorization request without session');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ class AuthorizationCodeListener
|
|||||||
array $required,
|
array $required,
|
||||||
string $reason,
|
string $reason,
|
||||||
): void {
|
): void {
|
||||||
$this->authenticationLogger->info('Authorization request denied', [
|
$this->authLogger->info('Authorization request denied', [
|
||||||
'client' => $client,
|
'client' => $client,
|
||||||
'user_id' => $user->getId(),
|
'user_id' => $user->getId(),
|
||||||
'required_roles' => $required,
|
'required_roles' => $required,
|
||||||
|
|||||||
Reference in new issue
Block a user