/** * Perform anonymous authentication using SASL ANONYMOUS. Your XMPP service must support this authentication * mechanism. This method also calls {@link #addEnabledSaslMechanism(String)} with "ANONYMOUS" as argument. * * @return a reference to this builder. */ public B performSaslAnonymousAuthentication() { if (!SASLAuthentication.isSaslMechanismRegistered(SASLAnonymous.NAME)) { throw new IllegalArgumentException("SASL " + SASLAnonymous.NAME + " is not registered"); } throwIfEnabledSaslMechanismsSet(); allowEmptyOrNullUsernames(); addEnabledSaslMechanism(SASLAnonymous.NAME); saslMechanismsSealed = true; return getThis(); }
/** * Perform authentication using SASL EXTERNAL. Your XMPP service must support this * authentication mechanism. This method also calls {@link #addEnabledSaslMechanism(String)} with "EXTERNAL" as * argument. It also calls {@link #allowEmptyOrNullUsernames()} and {@link #setSecurityMode(ConnectionConfiguration.SecurityMode)} to * {@link SecurityMode#required}. * * @param sslContext custom SSLContext to be used. * @return a reference to this builder. */ public B performSaslExternalAuthentication(SSLContext sslContext) { if (!SASLAuthentication.isSaslMechanismRegistered(SASLMechanism.EXTERNAL)) { throw new IllegalArgumentException("SASL " + SASLMechanism.EXTERNAL + " is not registered"); } setCustomSSLContext(sslContext); throwIfEnabledSaslMechanismsSet(); allowEmptyOrNullUsernames(); setSecurityMode(SecurityMode.required); addEnabledSaslMechanism(SASLMechanism.EXTERNAL); saslMechanismsSealed = true; return getThis(); }
/** * Perform anonymous authentication using SASL ANONYMOUS. Your XMPP service must support this authentication * mechanism. This method also calls {@link #addEnabledSaslMechanism(String)} with "ANONYMOUS" as argument. * * @return a reference to this builder. */ public B performSaslAnonymousAuthentication() { if (!SASLAuthentication.isSaslMechanismRegistered(SASLAnonymous.NAME)) { throw new IllegalArgumentException("SASL " + SASLAnonymous.NAME + " is not registered"); } throwIfEnabledSaslMechanismsSet(); allowEmptyOrNullUsernames(); addEnabledSaslMechanism(SASLAnonymous.NAME); saslMechanismsSealed = true; return getThis(); }
/** * Perform authentication using SASL EXTERNAL. Your XMPP service must support this * authentication mechanism. This method also calls {@link #addEnabledSaslMechanism(String)} with "EXTERNAL" as * argument. It also calls {@link #allowEmptyOrNullUsernames()} and {@link #setSecurityMode(ConnectionConfiguration.SecurityMode)} to * {@link SecurityMode#required}. * * @param sslContext custom SSLContext to be used. * @return a reference to this builder. */ public B performSaslExternalAuthentication(SSLContext sslContext) { if (!SASLAuthentication.isSaslMechanismRegistered(SASLMechanism.EXTERNAL)) { throw new IllegalArgumentException("SASL " + SASLMechanism.EXTERNAL + " is not registered"); } setCustomSSLContext(sslContext); throwIfEnabledSaslMechanismsSet(); allowEmptyOrNullUsernames(); setSecurityMode(SecurityMode.required); addEnabledSaslMechanism(SASLMechanism.EXTERNAL); saslMechanismsSealed = true; return getThis(); }