Commit 29ef337f authored by Guus der Kinderen's avatar Guus der Kinderen Committed by daryl herzmann

OF-477: Adding a realm setting that is specific to Sun's DIGEST-MD5 (#592)

* OF-477: SASL realm should be XMPP domain.

* OF-477: DigestMD5-specific Realm property.
parent 62a64a25
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
package org.jivesoftware.openfire.net; package org.jivesoftware.openfire.net;
import com.sun.mail.smtp.DigestMD5;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
import org.dom4j.Element; import org.dom4j.Element;
import org.dom4j.Namespace; import org.dom4j.Namespace;
...@@ -268,6 +269,7 @@ public class SASLAuthentication { ...@@ -268,6 +269,7 @@ public class SASLAuthentication {
final Map<String, Object> props = new HashMap<>(); final Map<String, Object> props = new HashMap<>();
props.put( LocalSession.class.getCanonicalName(), session ); props.put( LocalSession.class.getCanonicalName(), session );
props.put( Sasl.POLICY_NOANONYMOUS, Boolean.toString( !JiveGlobals.getBooleanProperty( "xmpp.auth.anonymous" ) ) ); props.put( Sasl.POLICY_NOANONYMOUS, Boolean.toString( !JiveGlobals.getBooleanProperty( "xmpp.auth.anonymous" ) ) );
props.put( "com.sun.security.sasl.digest.realm", XMPPServer.getInstance().getServerInfo().getXMPPDomain() );
SaslServer saslServer = Sasl.createSaslServer( mechanismName, "xmpp", fqhn, props, new XMPPCallbackHandler() ); SaslServer saslServer = Sasl.createSaslServer( mechanismName, "xmpp", fqhn, props, new XMPPCallbackHandler() );
if ( saslServer == null ) if ( saslServer == null )
......
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