public class LoginByPasswordStrategy extends java.lang.Object implements JabberLoginStrategy
Constructor and Description |
---|
LoginByPasswordStrategy(AbstractProtocolProviderService protocolProvider,
AccountID accountID)
Create a login strategy that logs in using user credentials (username
and password)
|
Modifier and Type | Method and Description |
---|---|
javax.net.ssl.SSLContext |
createSslContext(CertificateService cs,
javax.net.ssl.X509ExtendedTrustManager trustManager)
Prepares an SSL Context that is customized SSL context.
|
boolean |
isTlsRequired()
Is TLS required for this login strategy / account?
|
boolean |
login(org.jivesoftware.smack.Connection connection,
java.lang.String userName,
java.lang.String resource)
Performs the login on an XMPP connection using SASL PLAIN.
|
boolean |
loginPreparationSuccessful()
Determines whether the strategy is ready to perform the login.
|
UserCredentials |
prepareLogin(SecurityAuthority authority,
int reasonCode)
Loads the account passwords as preparation for the login.
|
public LoginByPasswordStrategy(AbstractProtocolProviderService protocolProvider, AccountID accountID)
protocolProvider
- protocol provider service to fire registration
change events.accountID
- The accountID to use for the login.public UserCredentials prepareLogin(SecurityAuthority authority, int reasonCode)
prepareLogin
in interface JabberLoginStrategy
authority
- SecurityAuthority to obtain the passwordreasonCode
- reason why we're preparing for loginSecurityAuthority
public boolean loginPreparationSuccessful()
loginPreparationSuccessful
in interface JabberLoginStrategy
public boolean login(org.jivesoftware.smack.Connection connection, java.lang.String userName, java.lang.String resource) throws org.jivesoftware.smack.XMPPException
login
in interface JabberLoginStrategy
connection
- The connection on which the login is performed.userName
- The username for the login.resource
- The XMPP resource.org.jivesoftware.smack.XMPPException
public boolean isTlsRequired()
JabberLoginStrategy
isTlsRequired
in interface JabberLoginStrategy
public javax.net.ssl.SSLContext createSslContext(CertificateService cs, javax.net.ssl.X509ExtendedTrustManager trustManager) throws java.security.GeneralSecurityException
createSslContext
in interface JabberLoginStrategy
cs
- The certificate service that provides the context.trustManager
- The TrustManager to use within the context.java.security.GeneralSecurityException
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.