From ac7cd3ac1cd79eff3a8e20e23e5a550fb68b8af2 Mon Sep 17 00:00:00 2001 From: Sai Gandham Date: Fri, 15 Feb 2019 10:06:31 -0600 Subject: fix shiro logs looping issue Issue-ID: AAF-655 Change-Id: I6719683718ec8dc2695df1eb14b6b490df5976c5 Signed-off-by: Sai Gandham --- .../src/main/java/org/onap/aaf/cadi/shiro/AAFAuthenticationInfo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthenticationInfo.java') diff --git a/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthenticationInfo.java b/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthenticationInfo.java index 45bdadc..beb9707 100644 --- a/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthenticationInfo.java +++ b/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthenticationInfo.java @@ -36,7 +36,7 @@ import org.onap.aaf.cadi.Hash; public class AAFAuthenticationInfo implements AuthenticationInfo { private static final long serialVersionUID = -1502704556864321020L; - final static Logger logger = LoggerFactory.getLogger(AAFAuthenticationInfo.class); + final static Logger logger = LoggerFactory.getLogger(AAFAuthenticationInfo.class); // We assume that Shiro is doing Memory Only, and this salt is not needed cross process private final static int salt = new SecureRandom().nextInt(); @@ -52,11 +52,13 @@ public class AAFAuthenticationInfo implements AuthenticationInfo { } @Override public byte[] getCredentials() { +// logger.info("AAFAuthenticationInfo.getCredentials"); return hash; } @Override public PrincipalCollection getPrincipals() { +// logger.info( "AAFAuthenticationInfo.getPrincipals"); return apc; } @@ -65,6 +67,7 @@ public class AAFAuthenticationInfo implements AuthenticationInfo { UsernamePasswordToken upt = (UsernamePasswordToken)atoken; if(apc.getPrimaryPrincipal().getName().equals(upt.getPrincipal())) { byte[] newhash = getSaltedCred(new String(upt.getPassword())); + logger.info("Successful authentication attempt by " +upt.getPrincipal()); if(newhash.length==hash.length) { for(int i=0;i