Package com.sun.security.auth.callback

Examples of com.sun.security.auth.callback.DialogCallbackHandler


  System.exit(0);
    }

    private static Subject getLoginSubject(String loginName) throws Exception {
  LoginContext ctx =
      new LoginContext(loginName, new DialogCallbackHandler());
  ctx.login();
  return ctx.getSubject();
    }
View Full Code Here


import com.sun.security.auth.callback.DialogCallbackHandler;
import javax.security.auth.callback.*;

public class Default {
   public static void main(String args[]) throws Exception {
        DialogCallbackHandler h = new DialogCallbackHandler();
        TextOutputCallback toc = new TextOutputCallback
                        (TextOutputCallback.INFORMATION,
                        "hello");
        TextOutputCallback toc2 = new TextOutputCallback
                        (TextOutputCallback.INFORMATION,
                        "world");
        ConfirmationCallback cc = new ConfirmationCallback
                        ("Correct?",
                        ConfirmationCallback.INFORMATION,
                        ConfirmationCallback.YES_NO_OPTION,
                        ConfirmationCallback.NO);

        Callback[] callbacks = { toc, toc2, cc };
        h.handle(callbacks);

        if (cc.getSelectedIndex() == ConfirmationCallback.YES) {
            System.out.println("yes");
        } else {
            System.out.println("no");
View Full Code Here

TOP

Related Classes of com.sun.security.auth.callback.DialogCallbackHandler

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.