public boolean isComplete() { return saslServer.isComplete(); }
public boolean isComplete() { return saslServer.isComplete(); }
public boolean isComplete() { return saslServer.isComplete(); }
@Override protected boolean isComplete() { return server.isComplete(); }
@Override public boolean isSuccessful() { return server.isComplete(); }
public boolean isComplete() { return saslServer.isComplete(); }
public boolean isComplete() { return delegate.isComplete(); }
public boolean isComplete() { return saslServer.isComplete(); }
@Override public boolean needsWrapping() { if (server.isComplete()) { String qop = (String) server.getNegotiatedProperty(Sasl.QOP); return (qop != null && (qop.equalsIgnoreCase("auth-int") || qop.equalsIgnoreCase("auth-conf"))); } else { return false; } }
public boolean isComplete() { if (client != null) return client.isComplete(); else return server.isComplete(); }
/** * Evaluate a sasl response. If the result is {@code false} then the negotiation is not yet complete and the data * written into the destination buffer needs to be sent to the server as a response. If the result is {@code true} * then negotiation was successful and no response needs to be sent to the client (other than a successful completion * message, depending on the protocol). * <p> * The {@code source} buffer should have its position and remaining length set to encompass exactly one SASL * message. The SASL message itself does not encode any length information so it is up to the protocol implementer * to ensure that the message is properly framed. * * @param server the SASL server to use to evaluate the response message * @param destination the destination buffer into which the response message should be written, if any * @param source the source buffer from which the response message should be read * @return {@code true} if negotiation is complete and successful, {@code false} otherwise * @throws SaslException if negotiation failed or another error occurred */ public static boolean evaluateResponse(SaslServer server, ByteBuffer destination, ByteBuffer source) throws SaslException { final byte[] result; result = evaluateResponse(server, source); if (result != null) { if (destination == null) { throw msg.extraResponse(); } destination.put(result); return server.isComplete(); } else { return true; } }
@Override public void dispose() throws IOException { if (!server.isComplete()) { onError(new SaslException("Server closed before SASL negotiation finished.")); } server.dispose(); }
private RpcSaslProto processSaslToken(RpcSaslProto saslMessage) throws SaslException { if (!saslMessage.hasToken()) { throw new SaslException("Client did not send a token"); } byte[] saslToken = saslMessage.getToken().toByteArray(); if (LOG.isDebugEnabled()) { LOG.debug("Have read input token of size " + saslToken.length + " for processing by saslServer.evaluateResponse()"); } saslToken = saslServer.evaluateResponse(saslToken); return buildSaslResponse( saslServer.isComplete() ? SaslState.SUCCESS : SaslState.CHALLENGE, saslToken); }
QuorumAuth.QUORUM_SERVER_SASL_DIGEST, serverLogin.callbackHandler, LOG); while (!ss.isComplete()) { challenge = ss.evaluateResponse(token); if (!ss.isComplete()) { if (ss.isComplete()) { send(dout, challenge, QuorumAuth.Status.SUCCESS); LOG.info("Successfully completed the authentication using SASL. learner addr: {}",
@Override public Message nextMessage(Address address, SaslHeader header) throws SaslException { Message message = new Message(address).setFlag(Message.Flag.OOB); byte[] challenge = server.evaluateResponse(header.getPayload()); if (server.isComplete()) { latch.countDown(); } if (challenge != null) { return message.putHeader(SASL.SASL_ID, new SaslHeader(Type.CHALLENGE, challenge)); } else { return null; } }
return; if (saslServer != null && saslServer.isComplete()) { setSaslState(SaslState.COMPLETE); return; if (saslServer.isComplete()) setSaslState(SaslState.COMPLETE); break;
@Override public SaslMessage handleSaslMessage(SaslMessage message) throws SaslException { switch (message.getMessageType()) { case CHALLENGE: byte[] saslResponse = mSaslServer.evaluateResponse(message.getMessage().toByteArray()); SaslMessage.Builder response = SaslMessage.newBuilder(); if (mSaslServer.isComplete()) { response.setMessageType(SaslMessageType.SUCCESS); } else { response.setMessageType(SaslMessageType.CHALLENGE); } if (saslResponse != null) { response.setMessage(ByteString.copyFrom(saslResponse)); } return response.build(); default: throw new SaslException( "Server can't process Sasl message type:" + message.getMessageType().name()); } } }
private void handleSaslToken(byte[] clientToken) throws IOException { if (!enableKafkaSaslAuthenticateHeaders) { byte[] response = saslServer.evaluateResponse(clientToken); if (reauthInfo.reauthenticating() && saslServer.isComplete()) reauthInfo.ensurePrincipalUnchanged(principal()); if (response != null) { if (reauthInfo.reauthenticating() && saslServer.isComplete()) reauthInfo.ensurePrincipalUnchanged(principal()); long sessionLifetimeMs = !saslServer.isComplete() ? 0L : reauthInfo.calcCompletionTimesAndReturnSessionLifetimeMs(); sendKafkaResponse(requestContext, new SaslAuthenticateResponse(Errors.NONE, null, responseBuf, sessionLifetimeMs));
if (saslServer.isComplete()) { try { connectionHandler.sendAuthSuccess(id, challenge);
if (saslServer.isComplete()) { try { connectionHandler.sendAuthSuccess(id, challenge);