Package com.sun.jdmk.security.sasl

Examples of com.sun.jdmk.security.sasl.AuthenticateCallback


             String password)
  throws SaslException {
  final String msg =
      "PLAIN: Authentication credentials verification failed!";
  char passwd[] = password.toCharArray();
  AuthenticateCallback authnCb =
      new AuthenticateCallback(username, passwd);
  for (int i = 0; i < passwd.length; i++)
      passwd[i] = ' ';
  passwd = null;
  try {
      cbh.handle(new Callback[] { authnCb });
        } catch (IOException e) {
            throw new SaslException(msg, e);
        } catch (UnsupportedCallbackException e) {
            throw new SaslException(msg, e);
        }
  authnCb.clearPassword();
  if (!authnCb.isAuthenticated()) {
            throw new AuthenticationException(msg);
  }
    }
View Full Code Here

TOP

Related Classes of com.sun.jdmk.security.sasl.AuthenticateCallback

Copyright © 2018 www.massapicom. 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.