Commit df58abfb authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1092: POLICY_NOANONYMOUS property value must be a String

Although it evaluates as a boolean, the POLICY_NOANONYMOUS property value must
be a String value (as defined by javax.security.sasl.Sasl#POLICY_NOANONYMOUS)
parent 4bd82c0b
......@@ -230,7 +230,7 @@ public class SASLAuthentication {
// Construct the configuration properties
final Map<String, Object> props = new HashMap<>();
props.put( LocalClientSession.class.getCanonicalName(), session );
props.put( Sasl.POLICY_NOANONYMOUS, !XMPPServer.getInstance().getIQAuthHandler().isAnonymousAllowed() );
props.put( Sasl.POLICY_NOANONYMOUS, Boolean.toString( !XMPPServer.getInstance().getIQAuthHandler().isAnonymousAllowed() ) );
SaslServer saslServer = Sasl.createSaslServer( mechanismName, "xmpp", session.getServerName(), props, new XMPPCallbackHandler() );
if ( saslServer == null )
......
......@@ -134,7 +134,7 @@ public class SaslServerFactoryImpl implements SaslServerFactory
{
if ( props != null )
{
if ( mechanism.allowsAnonymous && props.containsKey( Sasl.POLICY_NOANONYMOUS ) && (Boolean) props.get( Sasl.POLICY_NOANONYMOUS ) )
if ( mechanism.allowsAnonymous && props.containsKey( Sasl.POLICY_NOANONYMOUS ) && Boolean.parseBoolean( (String) props.get( Sasl.POLICY_NOANONYMOUS ) ) )
{
// Do not include a mechanism that allows anonymous authentication when the 'no anonymous' policy is set.
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment