Log NetconfServer authentication fail when authProvider is missing. 27/20027/2
authorTomas Cere <tcere@cisco.com>
Mon, 11 May 2015 15:11:59 +0000 (17:11 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 19 May 2015 09:57:21 +0000 (09:57 +0000)
Change-Id: I43fef075fdf43624f1b83ddec16d77c129f98964
Signed-off-by: Tomas Cere <tcere@cisco.com>
opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/AuthProviderTracker.java

index c473b70eee7a981dadd71f671ec462abcab215cd..f88e45f592399440df7eafbfb6715a4d83bd402f 100644 (file)
@@ -86,6 +86,10 @@ final class AuthProviderTracker implements ServiceTrackerCustomizer<AuthProvider
 
     @Override
     public boolean authenticate(final String username, final String password, final ServerSession session) {
-        return authProvider == null ? false : authProvider.authenticated(username, password);
+        if (authProvider == null) {
+            LOG.warn("AuthProvider is missing, failing authentication");
+            return false;
+        }
+        return authProvider.authenticated(username, password);
     }
 }