Package javax.security.auth.callback

Examples of javax.security.auth.callback.CallbackHandler.handle()


        return new CallbackHandler() {
            public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
                serverCallbackHandler.handle(callbacks);
                if (handled(callbacks) == false) {
                    realmCallbackHandler.handle(callbacks);
                }
            }

            /*
            * Check if the PasswordCallback had already been handled.
View Full Code Here


                       
                        Callback [] cb = new Callback [] {
                            keystorePWCallback,
                        };
                       
                        cbh.handle(cb);
                        pw = keystorePWCallback.getPassword();
                        if(pw == null) {
                            pw = new char[0];
                        }
                    } else {
View Full Code Here

        }
       
        WSPasswordCallback[] cb = {new WSPasswordCallback(userName,
                                                          type)};
        try {
            handler.handle(cb);
        } catch (Exception e) {
            policyNotAsserted(info, e);
        }
       
        //get the password
View Full Code Here

        }
       
        WSPasswordCallback[] cb = {new WSPasswordCallback(userName,
                                                          type)};
        try {
            handler.handle(cb);
        } catch (Exception e) {
            policyNotAsserted(info, e, message);
        }
       
        //get the password
View Full Code Here

            }

            if (callbacks.size() > 0)
            {
               Callback[] cb = new Callback[callbacks.size()];
               cbh.handle(callbacks.toArray(cb));
            }

            if (trace)
               log.tracef("Setting authenticated subject (%s) on security context (%s)", executionSubject, sc);
View Full Code Here

                    return (AuthorizingCallbackHandler) cbh;
                } else {
                    return new AuthorizingCallbackHandler() {

                        public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
                            cbh.handle(callbacks);
                        }

                        public UserInfo createUserInfo(final Collection<Principal> remotingPrincipals) {
                            return new SimpleUserInfo(remotingPrincipals);
                        }
View Full Code Here

            return null;
        }
       
        WSPasswordCallback[] cb = {new WSPasswordCallback(userName, type)};
        try {
            handler.handle(cb);
        } catch (Exception e) {
            policyNotAsserted(info, e);
        }
       
        //get the password
View Full Code Here

        }
        LOG.fine("Using Signature algorithm " + sigAlgo);
       
        // Get the password
        WSPasswordCallback[] cb = {new WSPasswordCallback(signatureUser, WSPasswordCallback.SIGNATURE)};
        callbackHandler.handle(cb);
        String password = cb[0].getPassword();
       
        // Get the private key
        PrivateKey privateKey = null;
        try {
View Full Code Here

        LOG.fine("Using Signature algorithm " + sigAlgo);
        ub.queryParam(SSOConstants.SIG_ALG, URLEncoder.encode(sigAlgo, "UTF-8"));
       
        // Get the password
        WSPasswordCallback[] cb = {new WSPasswordCallback(signatureUser, WSPasswordCallback.SIGNATURE)};
        callbackHandler.handle(cb);
        String password = cb[0].getPassword();
       
        // Get the private key
        PrivateKey privateKey = null;
        try {
View Full Code Here

    CallbackHandler handler = new HttpRequestBasedCallbackHandler(args);
    Callback[] callbacks =
        new Callback[] {new NameCallback("ignored"), new PasswordCallback("ignored", false),};

    handler.handle(callbacks);

    assertEquals("seph@example.com", ((NameCallback) callbacks[0]).getName());
    assertEquals("internet", new String(((PasswordCallback) callbacks[1]).getPassword()));
  }
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.