archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject [6/8] archiva-redback-core git commit: Adding log statements
Date Fri, 10 Mar 2017 22:51:12 GMT
Adding log statements


Project: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/commit/98c98b39
Tree: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/tree/98c98b39
Diff: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/diff/98c98b39

Branch: refs/heads/master
Commit: 98c98b3979f35aef0435ca779e5bf73ed22ab3af
Parents: 461b7e9
Author: Martin Stockhammer <martin_s@apache.org>
Authored: Sun Feb 12 18:44:55 2017 +0100
Committer: Martin Stockhammer <martin_s@apache.org>
Committed: Sun Feb 12 18:44:55 2017 +0100

----------------------------------------------------------------------
 .../archiva/redback/rest/services/DefaultLoginService.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/98c98b39/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java
----------------------------------------------------------------------
diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java
b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java
index 3bc30bb..33160b4 100644
--- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java
+++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultLoginService.java
@@ -141,12 +141,15 @@ public class DefaultLoginService
         String userName = loginRequest.getUsername(), password = loginRequest.getPassword();
         PasswordBasedAuthenticationDataSource authDataSource =
             new PasswordBasedAuthenticationDataSource( userName, password );
+        log.debug("Login for {}",userName);
         try
         {
             SecuritySession securitySession = securitySystem.authenticate( authDataSource
);
+            log.debug("Security session {}", securitySession);
             if ( securitySession.getAuthenticationResult().isAuthenticated() )
             {
                 org.apache.archiva.redback.users.User user = securitySession.getUser();
+                log.debug("user {} authenticated", user.getUsername());
                 if ( !user.isValidated() )
                 {
                     log.info( "user {} not validated", user.getUsername() );
@@ -156,7 +159,10 @@ public class DefaultLoginService
                 restUser.setReadOnly( securitySystem.userManagerReadOnly() );
                 // validationToken only set during login
                 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) {
                     log.error("Validation token could not be created "+e.getMessage());
                 }


Mime
View raw message