mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
improve trace logging for authentication
This commit is contained in:
@@ -124,9 +124,16 @@ public class BasicSecurityContext implements WebSecurityContext
|
||||
HttpServletResponse response, String username,
|
||||
String password)
|
||||
{
|
||||
if ( logger.isTraceEnabled() ){
|
||||
logger.trace("start authentication for user {}", username);
|
||||
}
|
||||
AuthenticationResult ar = authenticator.authenticate(request, response,
|
||||
username, password);
|
||||
|
||||
if ( logger.isTraceEnabled() ){
|
||||
logger.trace("authentication ends with {}", ar);
|
||||
}
|
||||
|
||||
if ((ar != null) && (ar.getState() == AuthenticationState.SUCCESS))
|
||||
{
|
||||
authenticate(request, password, ar);
|
||||
|
||||
@@ -130,6 +130,12 @@ public class ChainAuthenticatonManager extends AbstractAuthenticationManager
|
||||
|
||||
if (ar == null)
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("no authentication result for user {} found in cache",
|
||||
username);
|
||||
}
|
||||
|
||||
ar = doAuthentication(request, response, username, password);
|
||||
|
||||
if ((ar != null) && ar.isCacheable())
|
||||
@@ -157,6 +163,11 @@ public class ChainAuthenticatonManager extends AbstractAuthenticationManager
|
||||
{
|
||||
for (AuthenticationHandler authenticator : authenticationHandlerSet)
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("close authenticator {}", authenticator.getClass());
|
||||
}
|
||||
|
||||
IOUtil.close(authenticator);
|
||||
}
|
||||
}
|
||||
@@ -172,6 +183,11 @@ public class ChainAuthenticatonManager extends AbstractAuthenticationManager
|
||||
{
|
||||
for (AuthenticationHandler authenticator : authenticationHandlerSet)
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("initialize authenticator {}", authenticator.getClass());
|
||||
}
|
||||
|
||||
authenticator.init(context);
|
||||
}
|
||||
|
||||
@@ -200,8 +216,19 @@ public class ChainAuthenticatonManager extends AbstractAuthenticationManager
|
||||
{
|
||||
AuthenticationResult ar = null;
|
||||
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("start authentication chain for user {}", username);
|
||||
}
|
||||
|
||||
for (AuthenticationHandler authenticator : authenticationHandlerSet)
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("check authenticator {} for user {}",
|
||||
authenticator.getClass(), username);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
AuthenticationResult result = authenticator.authenticate(request,
|
||||
|
||||
Reference in New Issue
Block a user