diff options
Diffstat (limited to 'Http')
-rw-r--r-- | Http/Firewall/AbstractAuthenticationListener.php | 7 | ||||
-rw-r--r-- | Http/Firewall/AbstractPreAuthenticatedListener.php | 4 | ||||
-rw-r--r-- | Http/Firewall/BasicAuthenticationListener.php | 4 | ||||
-rw-r--r-- | Http/Firewall/ContextListener.php | 2 | ||||
-rw-r--r-- | Http/Firewall/DigestAuthenticationListener.php | 4 | ||||
-rw-r--r-- | Http/Firewall/ExceptionListener.php | 4 | ||||
-rw-r--r-- | Http/Firewall/RememberMeListener.php | 2 | ||||
-rw-r--r-- | Http/Firewall/SwitchUserListener.php | 4 | ||||
-rw-r--r-- | Http/Firewall/UsernamePasswordFormAuthenticationListener.php | 2 | ||||
-rw-r--r-- | Http/RememberMe/AbstractRememberMeServices.php | 6 |
10 files changed, 21 insertions, 18 deletions
diff --git a/Http/Firewall/AbstractAuthenticationListener.php b/Http/Firewall/AbstractAuthenticationListener.php index c35ab35..bf61057 100644 --- a/Http/Firewall/AbstractAuthenticationListener.php +++ b/Http/Firewall/AbstractAuthenticationListener.php @@ -183,7 +183,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface private function onFailure(GetResponseEvent $event, Request $request, AuthenticationException $failed) { if (null !== $this->logger) { - $this->logger->debug(sprintf('Authentication request failed: %s', $failed->getMessage())); + $this->logger->info(sprintf('Authentication request failed: %s', $failed->getMessage())); } $this->securityContext->setToken(null); @@ -221,7 +221,10 @@ abstract class AbstractAuthenticationListener implements ListenerInterface private function onSuccess(GetResponseEvent $event, Request $request, TokenInterface $token) { if (null !== $this->logger) { - $this->logger->debug('User has been authenticated successfully'); + $this->logger->info(sprintf( + 'User "%s" has been authenticated successfully', + $token->getUsername() + )); } $this->securityContext->setToken($token); diff --git a/Http/Firewall/AbstractPreAuthenticatedListener.php b/Http/Firewall/AbstractPreAuthenticatedListener.php index 93c161a..332e3f8 100644 --- a/Http/Firewall/AbstractPreAuthenticatedListener.php +++ b/Http/Firewall/AbstractPreAuthenticatedListener.php @@ -76,7 +76,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface $token = $this->authenticationManager->authenticate(new PreAuthenticatedToken($user, $credentials, $this->providerKey)); if (null !== $this->logger) { - $this->logger->debug(sprintf('Authentication success: %s', $token)); + $this->logger->info(sprintf('Authentication success: %s', $token)); } $this->securityContext->setToken($token); @@ -88,7 +88,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface $this->securityContext->setToken(null); if (null !== $this->logger) { - $this->logger->debug(sprintf("Cleared security context due to exception: %s", $failed->getMessage())); + $this->logger->info(sprintf("Cleared security context due to exception: %s", $failed->getMessage())); } } } diff --git a/Http/Firewall/BasicAuthenticationListener.php b/Http/Firewall/BasicAuthenticationListener.php index 72df041..9669853 100644 --- a/Http/Firewall/BasicAuthenticationListener.php +++ b/Http/Firewall/BasicAuthenticationListener.php @@ -67,7 +67,7 @@ class BasicAuthenticationListener implements ListenerInterface } if (null !== $this->logger) { - $this->logger->debug(sprintf('Basic Authentication Authorization header found for user "%s"', $username)); + $this->logger->info(sprintf('Basic Authentication Authorization header found for user "%s"', $username)); } try { @@ -77,7 +77,7 @@ class BasicAuthenticationListener implements ListenerInterface $this->securityContext->setToken(null); if (null !== $this->logger) { - $this->logger->debug(sprintf('Authentication request failed: %s', $failed->getMessage())); + $this->logger->info(sprintf('Authentication request failed for user "%s": %s', $username, $failed->getMessage())); } if ($this->ignoreFailure) { diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php index dccbd5c..950429a 100644 --- a/Http/Firewall/ContextListener.php +++ b/Http/Firewall/ContextListener.php @@ -139,7 +139,7 @@ class ContextListener implements ListenerInterface // let's try the next user provider } catch (UsernameNotFoundException $notFound) { if (null !== $this->logger) { - $this->logger->debug(sprintf('Username "%s" could not be found.', $user->getUsername())); + $this->logger->warn(sprintf('Username "%s" could not be found.', $user->getUsername())); } return null; diff --git a/Http/Firewall/DigestAuthenticationListener.php b/Http/Firewall/DigestAuthenticationListener.php index f2e1f9e..5c529da 100644 --- a/Http/Firewall/DigestAuthenticationListener.php +++ b/Http/Firewall/DigestAuthenticationListener.php @@ -114,7 +114,7 @@ class DigestAuthenticationListener implements ListenerInterface } if (null !== $this->logger) { - $this->logger->debug(sprintf('Authentication success for user "%s" with response "%s"', $digestAuth->getUsername(), $digestAuth->getResponse())); + $this->logger->info(sprintf('Authentication success for user "%s" with response "%s"', $digestAuth->getUsername(), $digestAuth->getResponse())); } $this->securityContext->setToken(new UsernamePasswordToken($user, $user->getPassword(), $this->providerKey)); @@ -125,7 +125,7 @@ class DigestAuthenticationListener implements ListenerInterface $this->securityContext->setToken(null); if (null !== $this->logger) { - $this->logger->debug($authException); + $this->logger->info($authException); } $event->setResponse($this->authenticationEntryPoint->start($request, $authException)); diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php index bedbe4a..5755c2d 100644 --- a/Http/Firewall/ExceptionListener.php +++ b/Http/Firewall/ExceptionListener.php @@ -88,7 +88,7 @@ class ExceptionListener $token = $this->context->getToken(); if (!$this->authenticationTrustResolver->isFullFledged($token)) { if (null !== $this->logger) { - $this->logger->info('Access denied (user is not fully authenticated); redirecting to authentication entry point'); + $this->logger->debug('Access denied (user is not fully authenticated); redirecting to authentication entry point'); } try { @@ -100,7 +100,7 @@ class ExceptionListener } } else { if (null !== $this->logger) { - $this->logger->info('Access is denied (and user is neither anonymous, nor remember-me)'); + $this->logger->debug('Access is denied (and user is neither anonymous, nor remember-me)'); } try { diff --git a/Http/Firewall/RememberMeListener.php b/Http/Firewall/RememberMeListener.php index cd49ef1..9b144b6 100644 --- a/Http/Firewall/RememberMeListener.php +++ b/Http/Firewall/RememberMeListener.php @@ -88,7 +88,7 @@ class RememberMeListener implements ListenerInterface } } catch (AuthenticationException $failed) { if (null !== $this->logger) { - $this->logger->debug( + $this->logger->warn( 'SecurityContext not populated with remember-me token as the' .' AuthenticationManager rejected the AuthenticationToken returned' .' by the RememberMeServices: '.$failed->getMessage() diff --git a/Http/Firewall/SwitchUserListener.php b/Http/Firewall/SwitchUserListener.php index c3c46e5..8e45508 100644 --- a/Http/Firewall/SwitchUserListener.php +++ b/Http/Firewall/SwitchUserListener.php @@ -88,7 +88,7 @@ class SwitchUserListener implements ListenerInterface $this->securityContext->setToken($this->attemptSwitchUser($request)); } catch (AuthenticationException $e) { if (null !== $this->logger) { - $this->logger->debug(sprintf('Switch User failed: "%s"', $e->getMessage())); + $this->logger->warn(sprintf('Switch User failed: "%s"', $e->getMessage())); } } } @@ -120,7 +120,7 @@ class SwitchUserListener implements ListenerInterface $username = $request->get($this->usernameParameter); if (null !== $this->logger) { - $this->logger->debug(sprintf('Attempt to switch to user "%s"', $username)); + $this->logger->info(sprintf('Attempt to switch to user "%s"', $username)); } $user = $this->provider->loadUserByUsername($username); diff --git a/Http/Firewall/UsernamePasswordFormAuthenticationListener.php b/Http/Firewall/UsernamePasswordFormAuthenticationListener.php index a6b6968..816cae4 100644 --- a/Http/Firewall/UsernamePasswordFormAuthenticationListener.php +++ b/Http/Firewall/UsernamePasswordFormAuthenticationListener.php @@ -56,7 +56,7 @@ class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationL { if ($this->options['post_only'] && 'post' !== strtolower($request->getMethod())) { if (null !== $this->logger) { - $this->logger->debug(sprintf('Authentication method not supported: %s.', $request->getMethod())); + $this->logger->err(sprintf('Authentication method not supported: %s.', $request->getMethod())); } return null; diff --git a/Http/RememberMe/AbstractRememberMeServices.php b/Http/RememberMe/AbstractRememberMeServices.php index a7c63ef..74acdef 100644 --- a/Http/RememberMe/AbstractRememberMeServices.php +++ b/Http/RememberMe/AbstractRememberMeServices.php @@ -122,15 +122,15 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface throw $theft; } catch (UsernameNotFoundException $notFound) { if (null !== $this->logger) { - $this->logger->debug('User for remember-me cookie not found.'); + $this->logger->info('User for remember-me cookie not found.'); } } catch (UnsupportedUserException $unSupported) { if (null !== $this->logger) { - $this->logger->debug('User class for remember-me cookie not supported.'); + $this->logger->err('User class for remember-me cookie not supported.'); } } catch (AuthenticationException $invalid) { if (null !== $this->logger) { - $this->logger->debug('Remember-Me authentication failed: '.$invalid->getMessage()); + $this->logger->err('Remember-Me authentication failed: '.$invalid->getMessage()); } } |