Examples of evaluateResponse()


Examples of javax.security.sasl.SaslServer.evaluateResponse()

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    try {
      SaslServer sasl = null;
      try {
        return (sasl = this.saslServers.pull(context)) != null ? context.write(new Success(sasl.evaluateResponse(protocol.cast(Response.class).getResponse()))).auth(true).auth() : false;
      } finally {
        if (sasl != null) {
          sasl.dispose();
        }
      }
View Full Code Here

Examples of javax.security.sasl.SaslServer.evaluateResponse()

    private void secure(Connection conn, byte[] response)
    {
        SaslServer ss = conn.getSaslServer();
        try
        {
            byte[] challenge = ss.evaluateResponse(response);
            if (ss.isComplete())
            {
                ss.dispose();
                conn.connectionTune
                    (getChannelMax(),
View Full Code Here

Examples of javax.security.sasl.SaslServer.evaluateResponse()

    }

    private AuthenticationResult authenticateCramMd5(String userName, String userPassword) throws SaslException, Exception
    {
        SaslServer ss = _authenticationManager.createSaslServer("CRAM-MD5", "test", null);
        byte[] challenge = ss.evaluateResponse(new byte[0]);
        byte[] response = SaslUtil.generateCramMD5ClientResponse(userName, userPassword, challenge);

        AuthenticationResult result = _authenticationManager.authenticate(ss, response);
        return result;
    }
View Full Code Here

Examples of javax.security.sasl.SaslServer.evaluateResponse()

                                // RFC2831 (DIGEST-MD5) says the client MAY provide an initial response on subsequent
                                // authentication. Java SASL does not (currently) support this and thows an exception
                                // if we try.  This violates the RFC, so we just strip any initial token.
                                token = new byte[0];
                            }
                            byte[] challenge = ss.evaluateResponse(token);
                            if (ss.isComplete()) {
                                authenticationSuccessful(session, ss.getAuthorizationID(),
                                    challenge);
                                status = Status.authenticated;
                            }
View Full Code Here

Examples of javax.security.sasl.SaslServer.evaluateResponse()

                                else {
                                    byte[] data = StringUtils.decodeBase64(response);
                                    if (data == null) {
                                        data = new byte[0];
                                    }
                                    byte[] challenge = ss.evaluateResponse(data);
                                    if (ss.isComplete()) {
                                        authenticationSuccessful(session, ss.getAuthorizationID(),
                                                challenge);
                                        status = Status.authenticated;
                                    }
View Full Code Here

Examples of javax.security.sasl.SaslServer.evaluateResponse()

    private void secure(Connection conn, byte[] response)
    {
        SaslServer ss = conn.getSaslServer();
        try
        {
            byte[] challenge = ss.evaluateResponse(response);
            if (ss.isComplete())
            {
                ss.dispose();
                conn.connectionTune
                    (Integer.MAX_VALUE,
View Full Code Here

Examples of javax.security.sasl.SaslServer.evaluateResponse()

      } // end of if (ss == null)
      String data_str = (String)props.get(DATA_KEY);
      byte[] in_data =
        (data_str != null ? Base64.decode(data_str) : new byte[0]);
      log.finest("response: " + new String(in_data));
      byte[] challenge = ss.evaluateResponse(in_data);
      log.finest("challenge: " +
        (challenge != null ? new String(challenge) : "null"));
      String challenge_str = (challenge != null && challenge.length > 0
        ? Base64.encode(challenge) : null);
      props.put(RESULT_KEY, challenge_str);
View Full Code Here

Examples of javax.security.sasl.SaslServer.evaluateResponse()

        props.put("SaslServer", ss);
      } // end of if (ss == null)
      String data_str = (String)props.get(DATA_KEY);
      byte[] in_data =
        (data_str != null ? Base64.decode(data_str) : new byte[0]);
      byte[] challenge = ss.evaluateResponse(in_data);
      log.finest("challenge: " +
        (challenge != null ? new String(challenge) : "null"));
      String challenge_str = (challenge != null && challenge.length > 0
        ? Base64.encode(challenge) : null);
      props.put(RESULT_KEY, challenge_str);
View Full Code Here

Examples of javax.security.sasl.SaslServer.evaluateResponse()

      } // end of if (ss == null)
      String data_str = (String)props.get(DATA_KEY);
      byte[] in_data =
        (data_str != null ? Base64.decode(data_str) : new byte[0]);
      log.finest("response: " + new String(in_data));
      byte[] challenge = ss.evaluateResponse(in_data);
      log.finest("challenge: " +
        (challenge != null ? new String(challenge) : "null"));
      String challenge_str = (challenge != null && challenge.length > 0
        ? Base64.encode(challenge) : null);
      props.put(RESULT_KEY, challenge_str);
View Full Code Here

Examples of javax.security.sasl.SaslServer.evaluateResponse()

        props.put("SaslServer", ss);
      } // end of if (ss == null)
      String data_str = (String)props.get(DATA_KEY);
      byte[] in_data =
        (data_str != null ? Base64.decode(data_str) : new byte[0]);
      byte[] challenge = ss.evaluateResponse(in_data);
      log.finest("challenge: " +
        (challenge != null ? new String(challenge) : "null"));
      String challenge_str = (challenge != null && challenge.length > 0
        ? Base64.encode(challenge) : null);
      props.put(RESULT_KEY, challenge_str);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.