Codota Logo
ConnectionConfiguration.setSASLAuthenticationEnabled
Code IndexAdd Codota to your IDE (free)

How to use
setSASLAuthenticationEnabled
method
in
org.jivesoftware.smack.ConnectionConfiguration

Best Java code snippets using org.jivesoftware.smack.ConnectionConfiguration.setSASLAuthenticationEnabled (Showing top 20 results out of 315)

  • Common ways to obtain ConnectionConfiguration
private void myMethod () {
ConnectionConfiguration c =
  • Codota IconString host;String serviceName;new ConnectionConfiguration(host, port, serviceName)
  • Codota IconString host;new ConnectionConfiguration(host, port)
  • Codota IconString serviceName;new ConnectionConfiguration(serviceName)
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222);
config.setSASLAuthenticationEnabled(true);
XMPPConnection xmpp = new XMPPConnection(config);
try
{
  SASLAuthentication.registerSASLMechanism("X-FACEBOOK-PLATFORM", SASLXFacebookPlatformMechanism.class);
  SASLAuthentication.supportSASLMechanism("X-FACEBOOK-PLATFORM", 0);
  xmpp.connect();
  xmpp.login(apiKey + "|" + sessionKey, sessionSecret, "Application");
} catch (XMPPException e)
{
  xmpp.disconnect();
  e.printStackTrace();
}
origin: stackoverflow.com

 ConnectionConfiguration connConfig = new ConnectionConfiguration(host,port,host);
connection = new XMPPConnection(connConfig);
connConfig.setSASLAuthenticationEnabled(true); 
connection.connect();
connection.login(userID, password);
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("mwbn43-1", 5222);
config.setSASLAuthenticationEnabled(false);
XMPPConnection xmpp = new XMPPConnection(config);
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration(XMPP_HOST, XMPP_PORT);
config.setCompressionEnabled(false);
config.setSASLAuthenticationEnabled(false);
connection = new XMPPConnection(config);
origin: stackoverflow.com

ConnectionConfiguration connFig = new ConnectionConfiguration(SERVER,
    PORT);
connFig.setSASLAuthenticationEnabled(true);
connection = new XMPPConnection(connFig);
origin: stackoverflow.com

 public void login(String userName, String password) throws XMPPException
{       
  SASLAuthentication.registerSASLMechanism("DIGEST-MD5",MySASLDigestMD5Mechanism. class);
  ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com",5222);

  config.setSASLAuthenticationEnabled(true);
  config.setRosterLoadedAtLogin (true);

  connection = new XMPPConnection(config);
  connection.connect();
  connection.login(userName, password);
}
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222);
config.setSASLAuthenticationEnabled(true);
mFbConnection = new XMPPConnection(config);

try {
  SASLAuthentication.registerSASLMechanism("X-FACEBOOK-PLATFORM", SASLXFacebookPlatformMechanism.class);
  SASLAuthentication.supportSASLMechanism("X-FACEBOOK-PLATFORM", 0);
  mFbConnection.connect();
  mFbConnection.login(apiKey, accessToken, "Application");
} catch (XMPPException e) {
  mFbConnection.disconnect();
  e.printStackTrace();
}
origin: stackoverflow.com

/* this config I missed out */
 ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
 config.setCompressionEnabled(true);
 config.setSASLAuthenticationEnabled(false);
 connection = new XMPPConnection(config);
origin: stackoverflow.com

 ConnectionConfiguration config;
config = new ConnectionConfiguration(ip, port, "Smack");
config.setSASLAuthenticationEnabled(false);
config.setReconnectionAllowed(true);
config.setCompressionEnabled(false);
config.setDebuggerEnabled(true);
connection = new XMPPConnection(config);
connection.connect();
if (connection.isConnected()) {
  connection.login(loginName, password);
}
origin: stackoverflow.com

SmackConfiguration.setPacketReplyTimeout(15000);
 ConnectionConfiguration connectionConfig = new ConnectionConfiguration(host, port);
 connectionConfig.setRosterLoadedAtLogin(true);
 connectionConfig.setSendPresence(true);
 connectionConfig.setSASLAuthenticationEnabled(false);
 connectionConfig.setReconnectionAllowed(true);
 connection = new XMPPConnection(connectionConfig);
origin: stackoverflow.com

 // Create the configuration for this new connection
ConnectionConfiguration config = new ConnectionConfiguration("jabber.org", 5222);
config.setCompressionEnabled(true);
config.setSASLAuthenticationEnabled(true);

Connection connection = new XMPPConnection(config);
// Connect to the server
connection.connect();
// Log into the server
connection.login("danilodeveloper", "password", "SomeResource");
// getting the Openfire contacts that danilodeveloper has
Roster roster = connection.getRoster();
// the contacts
Collection<RosterEntry> entries = roster.getEntries();
origin: stackoverflow.com

 private final static String server_host = "talk.google.com";
private final static int SERVER_PORT = 5222;
private final static String SERVICE_NAME = "gmail.com";

ConnectionConfiguration config = new ConnectionConfiguration( server_host, SERVER_PORT , SERVICE_NAME);
    XMPPConnection m_connection = new XMPPConnection(config);
        try {
           SASLAuthentication.supportSASLMechanism("PLAIN");
           config.setSASLAuthenticationEnabled(true);     
           m_connection.connect();
          Roster.setDefaultSubscriptionMode(Roster.SubscriptionMode.manual);
        } catch (XMPPException e) {
          e.printStackTrace();
        }
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222);
config.setSASLAuthenticationEnabled(true);
config.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);
XMPPConnection xmpp = new XMPPConnection(config);
SASLAuthentication.registerSASLMechanism("X-FACEBOOK-PLATFORM",SASLXFacebookPlatformMechanism.class);
SASLAuthentication.supportSASLMechanism("X-FACEBOOK-PLATFORM", 0);
xmpp.connect();
xmpp.login(appSecret, accessToken, "Application");
origin: org.igniterealtime.smack/smack

/**
 * Creates a new XMPP connection in the same way {@link #XMPPConnection(String,CallbackHandler)} does, but
 * with no callback handler for password prompting of the keystore.  This will work
 * in most cases, provided the client is not required to provide a certificate to 
 * the server.
 *
 * @param serviceName the name of the XMPP server to connect to; e.g. <tt>example.com</tt>.
 */
public XMPPConnection(String serviceName) {
  // Create the configuration for this new connection
  super(new ConnectionConfiguration(serviceName));
  config.setCompressionEnabled(false);
  config.setSASLAuthenticationEnabled(true);
  config.setDebuggerEnabled(DEBUG_ENABLED);
}
origin: org.littleshoot/smack-xmpp-3-2-2

/**
 * Creates a new XMPP connection in the same way {@link #XMPPConnection(String,CallbackHandler)} does, but
 * with no callback handler for password prompting of the keystore.  This will work
 * in most cases, provided the client is not required to provide a certificate to 
 * the server.
 *
 * @param serviceName the name of the XMPP server to connect to; e.g. <tt>example.com</tt>.
 */
public XMPPConnection(String serviceName) {
  // Create the configuration for this new connection
  super(new ConnectionConfiguration(serviceName));
  config.setCompressionEnabled(false);
  config.setSASLAuthenticationEnabled(true);
  config.setDebuggerEnabled(DEBUG_ENABLED);
}
origin: tiandawu/IotXmpp

/**
 * Creates a new XMPP connection in the same way {@link #XMPPConnection(String,CallbackHandler)} does, but
 * with no callback handler for password prompting of the keystore.  This will work
 * in most cases, provided the client is not required to provide a certificate to 
 * the server.
 *
 * @param serviceName the name of the XMPP server to connect to; e.g. <tt>example.com</tt>.
 */
public XMPPConnection(String serviceName) {
  // Create the configuration for this new connection
  super(new ConnectionConfiguration(serviceName));
  config.setCompressionEnabled(false);
  config.setSASLAuthenticationEnabled(true);
  config.setDebuggerEnabled(DEBUG_ENABLED);
}
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("your_server", port_no);
config.setSASLAuthenticationEnabled(true);
config.setCompressionEnabled(true);
config.setSecurityMode(SecurityMode.enabled);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
  config.setTruststoreType("AndroidCAStore");
  config.setTruststorePassword(null);
  config.setTruststorePath(null);
} else {
  config.setTruststoreType("BKS");
  String path = System.getProperty("javax.net.ssl.trustStore");
  if (path == null)
    path = System.getProperty("java.home") + File.separator + "etc"
      + File.separator + "security" + File.separator
      + "cacerts.bks";
  config.setTruststorePath(path);
}
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222); 
config.setSASLAuthenticationEnabled(true); 
XMPPConnection xmpp = new XMPPConnection(config); 
try 
{     
  SASLAuthentication.registerSASLMechanism("X-FACEBOOK-PLATFORM", SASLXFacebookPlatformMechanism.class);     
  SASLAuthentication.supportSASLMechanism("X-FACEBOOK-PLATFORM", 0);     
  xmpp.connect();     
  xmpp.login(apiKey + "|" + sessionKey, sessionSecret, "Application"); 
} 
catch (XMPPException e) 
{     
  xmpp.disconnect();     
  e.printStackTrace(); 
}
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("your_server", port_no);
config.setSASLAuthenticationEnabled(true);
config.setCompressionEnabled(true);
config.setSecurityMode(SecurityMode.enabled);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
  config.setTruststoreType("AndroidCAStore");
  config.setTruststorePassword(null);
  config.setTruststorePath(null);
} else {
  config.setTruststoreType("BKS");
  String path = System.getProperty("javax.net.ssl.trustStore");
  if (path == null)
    path = System.getProperty("java.home") + File.separator + "etc"
      + File.separator + "security" + File.separator
      + "cacerts.bks";
  config.setTruststorePath(path);
}
origin: stackoverflow.com

 ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("localhost", 5222);
connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
connectionConfiguration.setSASLAuthenticationEnabled(true);
connectionConfiguration.setKeystorePath("src/main/resources/bogus_mina_tls.cert");
connectionConfiguration.setTruststorePath("src/main/resources/bogus_mina_tls.cert");
connectionConfiguration.setTruststorePassword("boguspw");
org.jivesoftware.smackConnectionConfigurationsetSASLAuthenticationEnabled

Javadoc

Sets whether the client will use SASL authentication when logging into the server. If SASL authenticatin fails then the client will try to use non-sasl authentication. By default, SASL is enabled.

Popular methods of ConnectionConfiguration

  • <init>
  • setSecurityMode
    Sets the TLS security mode used when making the connection. By default, the mode is SecurityMode#ena
  • setCompressionEnabled
    Sets if the connection is going to use stream compression. Stream compression will be requested afte
  • setDebuggerEnabled
    Sets if the new connection about to be establish is going to be debugged. By default the value of Co
  • setReconnectionAllowed
    Sets if the reconnection mechanism is allowed to be used. By default reconnection is allowed.
  • setRosterLoadedAtLogin
    Sets if the roster will be loaded from the server when logging in. This is the common behaviour for
  • getResource
    Returns the resource to use when trying to reconnect to the server.
  • getUsername
    Returns the username to use when trying to reconnect to the server.
  • isCompressionEnabled
    Returns true if the connection is going to use stream compression. Stream compression will be reques
  • setSendPresence
    Sets if an initial available presence will be sent to the server. By default an available presence w
  • setSocketFactory
    Sets the socket factory used to create new xmppConnection sockets. This is useful when connecting th
  • getCallbackHandler
    Returns a CallbackHandler to obtain information, such as the password or principal information durin
  • setSocketFactory,
  • getCallbackHandler,
  • getPassword,
  • getSecurityMode,
  • isSendPresence,
  • setCallbackHandler,
  • getHost,
  • getPort,
  • getServiceName

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now