Java 类org.jivesoftware.smack.SASLAuthentication 实例源码

项目:desktopclient-java    文件:KonConnection.java   
public KonConnection(EndpointServer server,
        PrivateKey privateKey,
        X509Certificate bridgeCert,
        boolean validateCertificate) {
    super(buildConfiguration(RESSOURCE,
            server,
            privateKey,
            bridgeCert,
            validateCertificate)
    );

    // blacklist PLAIN mechanism
    SASLAuthentication.blacklistSASLMechanism("PLAIN");

    // enable SM without resumption (XEP-0198)
    this.setUseStreamManagement(true);
    this.setUseStreamManagementResumption(false);
}
项目:TvPoo    文件:ConnectionManager.java   
public ConnectionManager(Context context,
        ConnectionStatusCallback statusCallback,
        CommunicationManager communicationManager) {
    this.statusCallback = statusCallback;
    this.communicationManager = communicationManager;

    smack = SmackAndroid.init(context);

    SASLAuthentication.registerSASLMechanism(GTalkOAuthSASLMechanism.NAME,
            GTalkOAuthSASLMechanism.class);
    SASLAuthentication
            .supportSASLMechanism(GTalkOAuthSASLMechanism.NAME, 0);

    ConnectionConfiguration configuration = new ConnectionConfiguration(
            "talk.google.com", 5222, "gmail.com");
    configuration.setSASLAuthenticationEnabled(true);

    connection = new XMPPConnection(configuration);
}
项目:libraries    文件:MessageSender.java   
private XMPPConnection createConnection() throws XMPPException {
  for (final String type : this.saslAuthenticationTypes) {
    SASLAuthentication.supportSASLMechanism(type, 0);
  }
  final XMPPConnection connection = new XMPPConnection(this.configuration);
  connection.connect();
  connection.login(this.userName, this.password);
  return connection;
}
项目:Smack    文件:SASLJavaXSmackInitializer.java   
@Override
public List<Exception> initialize() {
    SASLAuthentication.registerSASLMechanism(new SASLExternalMechanism());
    SASLAuthentication.registerSASLMechanism(new SASLGSSAPIMechanism());
    SASLAuthentication.registerSASLMechanism(new SASLDigestMD5Mechanism());
    SASLAuthentication.registerSASLMechanism(new SASLCramMD5Mechanism());
    SASLAuthentication.registerSASLMechanism(new SASLPlainMechanism());

    return null;
}
项目:Smack    文件:SASLProvidedSmackInitializer.java   
@Override
public List<Exception> initialize() {
    SASLAuthentication.registerSASLMechanism(new SASLDigestMD5Mechanism());
    SASLAuthentication.registerSASLMechanism(new SASLExternalMechanism());
    SASLAuthentication.registerSASLMechanism(new SASLPlainMechanism());
    return null;
}
项目:graylog-plugin-jabber    文件:JabberAlarmCallback.java   
private XMPPConnection login(final Configuration config) throws IOException, XMPPException, SmackException, KeyManagementException, NoSuchAlgorithmException {
    final String serviceName = isNullOrEmpty(config.getString(CK_SERVICE_NAME))
            ? config.getString(CK_HOSTNAME) : config.getString(CK_SERVICE_NAME);

    final XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder()
            .setHost(config.getString(CK_HOSTNAME))
            .setPort(config.getInt(CK_PORT))
            .setServiceName(serviceName)
            .setSendPresence(false);

    if (config.getBoolean(CK_ACCEPT_SELFSIGNED)) {
        TLSUtils.acceptAllCertificates(configBuilder);
    }

    final boolean requireSecurity = config.getBoolean(CK_REQUIRE_SECURITY);
    configBuilder.setSecurityMode(requireSecurity ?
            ConnectionConfiguration.SecurityMode.required : ConnectionConfiguration.SecurityMode.ifpossible);

    final XMPPTCPConnectionConfiguration connectionConfiguration = configBuilder.build();
    if (LOG.isDebugEnabled()) {
        LOG.debug("Supported SASL authentications: {}", SASLAuthentication.getRegisterdSASLMechanisms());
        LOG.debug("require_security: {}", requireSecurity);
        LOG.debug("Security mode: {}", connectionConfiguration.getSecurityMode());
        LOG.debug("Socket factory: {}", connectionConfiguration.getSocketFactory());
        LOG.debug("Keystore: {}", connectionConfiguration.getKeystorePath());
        LOG.debug("Keystore type: {}", connectionConfiguration.getKeystoreType());
    }

    final XMPPTCPConnection xmppConnection = new XMPPTCPConnection(connectionConfiguration);

    xmppConnection.connect();
    xmppConnection.login(config.getString(CK_USERNAME), config.getString(CK_PASSWORD));

    return xmppConnection;
}
项目:WNS    文件:XMPPHandlerJabber.java   
/**
 * Login creates a connection to the xmpp server and tries to login the
 * user, called from setProperties
 */
private void login() throws WNSException {
    try {
        log.debug("Trying to login");
        SASLAuthentication auth = this.connection.getSASLAuthentication();
        auth.authenticate(this.user, this.pwd, "");
        log.debug("Logged in");
    } catch (XMPPException e) {
        log.error("Login to XMPP server failed: " + e.toString());
        throw new WNSException("Login to XMPP server failed ");
    }
}
项目:whackpad    文件:SASLXFacebookPlatformMechanism.java   
public static void register()
{
    SASLAuthentication.registerSASLMechanism(NAME, SASLXFacebookPlatformMechanism.class);
    SASLAuthentication.supportSASLMechanism(NAME, 0);
}
项目:whackpad    文件:SASLXFacebookPlatformMechanism.java   
/**
 * Constructor.
 */
public SASLXFacebookPlatformMechanism(SASLAuthentication saslAuthentication)
{
    super(saslAuthentication);
}
项目:EIM    文件:SASLDigestMD5Mechanism.java   
public SASLDigestMD5Mechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:EIM    文件:SASLMechanism.java   
public SASLMechanism(SASLAuthentication saslAuthentication) {
    this.saslAuthentication = saslAuthentication;
}
项目:EIM    文件:SASLMechanism.java   
protected SASLAuthentication getSASLAuthentication() {
    return saslAuthentication;
}
项目:EIM    文件:SASLCramMD5Mechanism.java   
public SASLCramMD5Mechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:EIM    文件:SASLExternalMechanism.java   
public SASLExternalMechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:EIM    文件:SASLAnonymous.java   
public SASLAnonymous(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:EIM    文件:SASLPlainMechanism.java   
public SASLPlainMechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidpn_enhanced_client    文件:SASLDigestMD5Mechanism.java   
public SASLDigestMD5Mechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidpn_enhanced_client    文件:SASLMechanism.java   
public SASLMechanism(SASLAuthentication saslAuthentication) {
    this.saslAuthentication = saslAuthentication;
}
项目:androidpn_enhanced_client    文件:SASLMechanism.java   
protected SASLAuthentication getSASLAuthentication() {
    return saslAuthentication;
}
项目:androidpn_enhanced_client    文件:SASLCramMD5Mechanism.java   
public SASLCramMD5Mechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidpn_enhanced_client    文件:SASLExternalMechanism.java   
public SASLExternalMechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidpn_enhanced_client    文件:SASLAnonymous.java   
public SASLAnonymous(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidpn_enhanced_client    文件:SASLPlainMechanism.java   
public SASLPlainMechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidPN-client.    文件:SASLDigestMD5Mechanism.java   
public SASLDigestMD5Mechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidPN-client.    文件:SASLMechanism.java   
public SASLMechanism(SASLAuthentication saslAuthentication) {
    this.saslAuthentication = saslAuthentication;
}
项目:androidPN-client.    文件:SASLMechanism.java   
protected SASLAuthentication getSASLAuthentication() {
    return saslAuthentication;
}
项目:androidPN-client.    文件:SASLCramMD5Mechanism.java   
public SASLCramMD5Mechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidPN-client.    文件:SASLExternalMechanism.java   
public SASLExternalMechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidPN-client.    文件:SASLAnonymous.java   
public SASLAnonymous(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidPN-client.    文件:SASLPlainMechanism.java   
public SASLPlainMechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:androidPN-client.    文件:SASLFacebookConnect.java   
public SASLFacebookConnect(SASLAuthentication saslAuthentication) {
        super(saslAuthentication);
}
项目:xmppsupport_v2    文件:SASLDigestMD5Mechanism.java   
public SASLDigestMD5Mechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:xmppsupport_v2    文件:SASLMechanism.java   
public SASLMechanism(SASLAuthentication saslAuthentication) {
    this.saslAuthentication = saslAuthentication;
}
项目:xmppsupport_v2    文件:SASLMechanism.java   
protected SASLAuthentication getSASLAuthentication() {
    return saslAuthentication;
}
项目:xmppsupport_v2    文件:SASLCramMD5Mechanism.java   
public SASLCramMD5Mechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:xmppsupport_v2    文件:SASLExternalMechanism.java   
public SASLExternalMechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:xmppsupport_v2    文件:SASLAnonymous.java   
public SASLAnonymous(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}
项目:xmppsupport_v2    文件:SASLPlainMechanism.java   
public SASLPlainMechanism(SASLAuthentication saslAuthentication) {
    super(saslAuthentication);
}