public Sasl sasl() { if (_transport != null) { return _transport.sasl(); } else { return null; } }
public Sasl sasl() { if (_transport != null) { return _transport.sasl(); } else { return null; } }
public Sasl sasl() { if (_transport != null) { return _transport.sasl(); } else { return null; } }
@Override public void init(NetSocket socket, ProtonConnection protonConnection, Transport transport) { this.socket = socket; this.connection = protonConnection; this.sasl = transport.sasl(); sasl.client(); }
public void createClientSASL() { Sasl sasl = transport.sasl(); sasl.client(); sasl.setListener(this); }
public void createClientSASL() { Sasl sasl = transport.sasl(); sasl.client(); sasl.setListener(this); }
@Override public void createServerSASL(ServerSASL[] handlers) { this.serverSasl = transport.sasl(); saslHandlers = new HashMap<>(); String[] names = new String[handlers.length]; int count = 0; for (ServerSASL handler : handlers) { saslHandlers.put(handler.getName(), handler); names[count++] = handler.getName(); } this.serverSasl.server(); serverSasl.setMechanisms(names); }
public void createServerSASL(String[] mechanisms) { Sasl sasl = transport.sasl(); sasl.server(); sasl.setMechanisms(mechanisms); sasl.setListener(this); }
@Override public void init(NetSocket socket, ProtonConnection protonConnection, Transport transport) { this.sasl = transport.sasl(); sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(ProtonSaslAnonymousImpl.MECH_NAME); succeeded = false; }
private boolean isSaslAuthenticated(Connection connection, SaslMechanism mechanism) { Transport transport = connection.getTransport(); Sasl sasl = transport.sasl(); return sasl.getState() == PN_SASL_PASS && mechanism.completedSuccessfully(); }
@Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { LOG.debug("initializing SASL authenticator"); this.protonConnection = protonConnection; this.sasl = transport.sasl(); sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(AuthenticationConstants.MECHANISM_PLAIN, AuthenticationConstants.MECHANISM_EXTERNAL); if (socket.isSsl()) { LOG.trace("Client connected through a secured port"); try { peerCertificateChain = socket.sslSession().getPeerCertificates(); } catch (SSLPeerUnverifiedException e) { LOG.debug("Device's Identity cannot be verified: " + e.getMessage()); } } }
@Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { LOG.debug("initializing SASL authenticator"); this.protonConnection = protonConnection; this.sasl = transport.sasl(); // TODO determine supported mechanisms dynamically based on registered AuthenticationService implementations sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(MECHANISM_EXTERNAL, MECHANISM_PLAIN); if (socket.isSsl()) { LOG.debug("client connected using TLS, extracting client certificate chain"); try { peerCertificateChain = socket.peerCertificateChain(); LOG.debug("found valid client certificate DN [{}]", peerCertificateChain[0].getSubjectDN()); } catch (SSLPeerUnverifiedException e) { LOG.debug("could not extract client certificate chain, maybe TLS based client auth is not required"); } } }
@Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { LOG.debug("initializing SASL authenticator"); this.protonConnection = protonConnection; this.sasl = transport.sasl(); // TODO determine supported mechanisms dynamically based on registered AuthenticationService implementations sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(MECHANISM_EXTERNAL, MECHANISM_PLAIN); if (socket.isSsl()) { LOG.debug("client connected using TLS, extracting client certificate chain"); try { peerCertificateChain = socket.peerCertificateChain(); LOG.debug("found valid client certificate DN [{}]", peerCertificateChain[0].getSubjectDN()); } catch (final SSLPeerUnverifiedException e) { LOG.debug("could not extract client certificate chain, maybe TLS based client auth is not required"); } } }
@Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { LOG.debug("initializing SASL authenticator"); this.protonConnection = protonConnection; this.sasl = transport.sasl(); // TODO determine supported mechanisms dynamically based on registered AuthenticationService implementations sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(MECHANISM_EXTERNAL, MECHANISM_PLAIN); if (socket.isSsl()) { LOG.debug("client connected using TLS, extracting client certificate chain"); try { peerCertificateChain = socket.peerCertificateChain(); LOG.debug("found valid client certificate DN [{}]", peerCertificateChain[0].getSubjectDN()); } catch (final SSLPeerUnverifiedException e) { LOG.debug("could not extract client certificate chain, maybe TLS based client auth is not required"); } } }
@Override public void onConnectionBound(Event event) { TRACE_LOGGER.debug("onConnectionBound: hostname:{}", event.getConnection().getHostname()); Transport transport = event.getTransport(); this.addTransportLayers(event, (TransportInternal) transport); Sasl sasl = transport.sasl(); sasl.setMechanisms("ANONYMOUS"); }
@Override public void createClientSasl(ClientSASL clientSASL) { if (clientSASL != null) { clientSasl = transport.sasl(); clientSasl.setMechanisms(clientSASL.getName()); byte[] initialSasl = clientSASL.getBytes(); clientSasl.send(initialSasl, 0, initialSasl.length); } }
public void createServerSASL(String[] mechanisms) { requireHandler(); Sasl sasl = transport.sasl(); sasl.server(); sasl.setMechanisms(mechanisms); sasl.setListener(this); }
@Override public void onConnectionLocalOpen(Event event) { Connection connection = event.getConnection(); if (connection.getRemoteState() != EndpointState.UNINITIALIZED) { return; } Transport transport = Proton.transport(); transport.sasl(); transport.setEmitFlowEventOnSend(false); transport.bind(connection); }
@Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { // allow for frames bigger than 512 bytes to support mechanisms that send (for instance) tokens transport.setInitialRemoteMaxFrameSize(1024*1024); this.sasl = transport.sasl(); sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(getValidMechanisms(getPasswordHashAlgorithms())); connection = protonConnection; }
private void handleOpen(Event event) { Connection connection = event.getConnection(); if (connection.getRemoteState() != EndpointState.UNINITIALIZED) { return; } Transport transport = Proton.transport(); Sasl sasl = transport.sasl(); sasl.client(); sasl.setMechanisms("ANONYMOUS"); transport.webSocket(); transport.bind(connection); }