Adding log statements
This commit is contained in:
parent
461b7e98f8
commit
98c98b3979
|
@ -141,12 +141,15 @@ public class DefaultLoginService
|
||||||
String userName = loginRequest.getUsername(), password = loginRequest.getPassword();
|
String userName = loginRequest.getUsername(), password = loginRequest.getPassword();
|
||||||
PasswordBasedAuthenticationDataSource authDataSource =
|
PasswordBasedAuthenticationDataSource authDataSource =
|
||||||
new PasswordBasedAuthenticationDataSource( userName, password );
|
new PasswordBasedAuthenticationDataSource( userName, password );
|
||||||
|
log.debug("Login for {}",userName);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SecuritySession securitySession = securitySystem.authenticate( authDataSource );
|
SecuritySession securitySession = securitySystem.authenticate( authDataSource );
|
||||||
|
log.debug("Security session {}", securitySession);
|
||||||
if ( securitySession.getAuthenticationResult().isAuthenticated() )
|
if ( securitySession.getAuthenticationResult().isAuthenticated() )
|
||||||
{
|
{
|
||||||
org.apache.archiva.redback.users.User user = securitySession.getUser();
|
org.apache.archiva.redback.users.User user = securitySession.getUser();
|
||||||
|
log.debug("user {} authenticated", user.getUsername());
|
||||||
if ( !user.isValidated() )
|
if ( !user.isValidated() )
|
||||||
{
|
{
|
||||||
log.info( "user {} not validated", user.getUsername() );
|
log.info( "user {} not validated", user.getUsername() );
|
||||||
|
@ -156,7 +159,10 @@ public class DefaultLoginService
|
||||||
restUser.setReadOnly( securitySystem.userManagerReadOnly() );
|
restUser.setReadOnly( securitySystem.userManagerReadOnly() );
|
||||||
// validationToken only set during login
|
// validationToken only set during login
|
||||||
try {
|
try {
|
||||||
restUser.setValidationToken(securitySystem.getTokenManager().encryptToken(user.getUsername(), tokenLifetime));
|
String validationToken = securitySystem.getTokenManager().encryptToken(user.getUsername(), tokenLifetime);
|
||||||
|
restUser.setValidationToken(validationToken);
|
||||||
|
log.debug("Validation Token set {}",validationToken);
|
||||||
|
|
||||||
} catch (EncryptionFailedException e) {
|
} catch (EncryptionFailedException e) {
|
||||||
log.error("Validation token could not be created "+e.getMessage());
|
log.error("Validation token could not be created "+e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue