From 732ab160852f943cd847646861dd48370dd23ff3 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Sun, 31 Mar 2013 21:51:49 +0000 Subject: QPID-4462: simply return the PlainSaslServer directly instead of looking up it, bypassing the lack of previous registration Fix suggested by Alex Rudyy git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1463063 13f79535-47bb-0310-9956-ffa450edef68 --- .../security/auth/manager/SimpleLDAPAuthenticationManager.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'qpid/java') diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java index ee00e9850d..61cdf190b8 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManager.java @@ -21,7 +21,6 @@ package org.apache.qpid.server.security.auth.manager; import java.io.IOException; import java.security.Principal; -import java.util.HashMap; import java.util.Hashtable; import javax.naming.AuthenticationException; @@ -37,7 +36,6 @@ import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.sasl.AuthorizeCallback; -import javax.security.sasl.Sasl; import javax.security.sasl.SaslException; import javax.security.sasl.SaslServer; import org.apache.log4j.Logger; @@ -45,6 +43,7 @@ import org.apache.qpid.server.security.auth.AuthenticationResult; import org.apache.qpid.server.security.auth.AuthenticationResult.AuthenticationStatus; import org.apache.qpid.server.security.auth.UsernamePrincipal; import org.apache.qpid.server.security.auth.sasl.plain.PlainPasswordCallback; +import org.apache.qpid.server.security.auth.sasl.plain.PlainSaslServer; public class SimpleLDAPAuthenticationManager implements AuthenticationManager { @@ -83,9 +82,7 @@ public class SimpleLDAPAuthenticationManager implements AuthenticationManager { if(PLAIN_MECHANISM.equals(mechanism)) { - return Sasl.createSaslServer(PLAIN_MECHANISM, "AMQP", localFQDN, - new HashMap(), new PlainCallbackHandler()); - + return new PlainSaslServer(new SimpleLDAPPlainCallbackHandler()); } else { @@ -214,7 +211,7 @@ public class SimpleLDAPAuthenticationManager implements AuthenticationManager } } - private class PlainCallbackHandler implements CallbackHandler + private class SimpleLDAPPlainCallbackHandler implements CallbackHandler { @Override -- cgit v1.2.1