public class ProtonSaslClientAuthenticatorImpl extends Object implements ProtonSaslAuthenticator
| Constructor and Description |
|---|
ProtonSaslClientAuthenticatorImpl(String username,
String password,
Set<String> allowedSaslMechanisms,
Handler<AsyncResult<ProtonConnection>> handler)
Create the authenticator and initialize it.
|
| Modifier and Type | Method and Description |
|---|---|
void |
init(NetSocket socket,
ProtonConnection protonConnection,
org.apache.qpid.proton.engine.Transport transport) |
void |
process(Handler<Boolean> completionHandler)
Process the SASL authentication cycle until such time as an outcome is determined.
|
boolean |
succeeded()
Once called after process finished it returns true if the authentication succeeded.
|
public ProtonSaslClientAuthenticatorImpl(String username, String password, Set<String> allowedSaslMechanisms, Handler<AsyncResult<ProtonConnection>> handler)
username - The username provide credentials to the remote peer, or null if there is none.password - The password provide credentials to the remote peer, or null if there is none.allowedSaslMechanisms - The possible mechanism(s) to which the client should restrict its mechanism selection to if offered by the
server, or null/empty if no restriction.handler - The handler to convey the result of the SASL process to.
The async result will succeed if the SASL handshake completed successfully, it will fail with
MechanismMismatchException if this client does not support any of the SASL
mechanisms offered by the server,SaslSystemException if the SASL handshake fails with either of the
Sasl.SaslOutcome.PN_SASL_SYS, Sasl.SaslOutcome.PN_SASL_TEMP or
Sasl.SaslOutcome.PN_SASL_PERM outcomes,javax.security.sasl.AuthenticationException if the handshake fails with
the Sasl.SaslOutcome.PN_SASL_AUTH outcome orjavax.security.sasl.SaslException if the handshake fails due to
any other reason.public void init(NetSocket socket, ProtonConnection protonConnection, org.apache.qpid.proton.engine.Transport transport)
init in interface ProtonSaslAuthenticatorpublic void process(Handler<Boolean> completionHandler)
ProtonSaslAuthenticatorProtonSaslAuthenticator.succeeded().
Any processing of the connection and/or transport objects MUST occur on the calling Context, and the
completion handler MUST be invoked on this same context also. If the completion handler is called on another
context an IllegalStateException will be thrown.process in interface ProtonSaslAuthenticatorcompletionHandler - handler to call when processing of the current state is complete. Value given is true if the SASL
handshake completed.public boolean succeeded()
ProtonSaslAuthenticatorsucceeded in interface ProtonSaslAuthenticatorCopyright © 2020. All rights reserved.