Examples of ObjectCallback


Examples of org.eclipse.ecf.core.security.ObjectCallback

      return null;
    final CallbackHandler callbackHandler = connectContext.getCallbackHandler();
    if (callbackHandler == null)
      return null;
    final NameCallback usernameCallback = new NameCallback(USERNAME_PREFIX);
    final ObjectCallback passwordCallback = new ObjectCallback();
    callbackHandler.handle(new Callback[] {usernameCallback, passwordCallback});
    username = usernameCallback.getName();
    password = (String) passwordCallback.getObject();
    return new UsernamePasswordCredentials(username, password);
  }
View Full Code Here

Examples of org.eclipse.jetty.jaas.callback.ObjectCallback

    public Callback[] configureCallbacks ()
    {

        Callback[] callbacks = new Callback[3];
        callbacks[0] = new NameCallback("Enter user name");
        callbacks[1] = new ObjectCallback();
        callbacks[2] = new PasswordCallback("Enter password", false); //only used if framework does not support the ObjectCallback
        return callbacks;
    }
View Full Code Here

Examples of org.eclipse.jetty.plus.jaas.callback.ObjectCallback

*/
public class JettySupport {
    private static Callback[] createCallbacks() {
        Callback[] calls = new Callback[2];
        calls[0] = new NameCallback("Username: ");
        calls[1] = new ObjectCallback();
        return calls;
    }
View Full Code Here

Examples of org.jboss.security.auth.callback.ObjectCallback

            return true;
        }

        // Time to see if this is a delegation request.
        NameCallback ncb = new NameCallback("Username:");
        ObjectCallback ocb = new ObjectCallback("Password:");

        try {
            callbackHandler.handle(new Callback[] { ncb, ocb });
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            }
            return false; // If the CallbackHandler can not handle the required callbacks then no chance.
        }

        String name = ncb.getName();
        Object credential = ocb.getCredential();

        if (credential instanceof OuterUserCredential) {
            // This credential type will only be seen for a delegation request, if not seen then the request is not for us.

            if (delegationAcceptable(name, (OuterUserCredential) credential)) {
View Full Code Here

Examples of org.jboss.security.auth.callback.ObjectCallback

            return true;
        }

        // Time to see if this is a delegation request.
        NameCallback ncb = new NameCallback("Username:");
        ObjectCallback ocb = new ObjectCallback("Password:");

        try {
            callbackHandler.handle(new Callback[] { ncb, ocb });
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            }
            return false; // If the CallbackHandler can not handle the required callbacks then no chance.
        }

        String name = ncb.getName();
        Object credential = ocb.getCredential();

        if (credential instanceof OuterUserPlusCredential) {

            OuterUserPlusCredential oupc = (OuterUserPlusCredential) credential;
View Full Code Here

Examples of org.jboss.security.auth.callback.ObjectCallback

      if (callbackHandler == null)
      {
         throw new LoginException("Error: no CallbackHandler available to collect authentication information");
      }
      NameCallback nc = new NameCallback("Alias: ");
      ObjectCallback oc = new ObjectCallback("Certificate: ");
      Callback[] callbacks = { nc, oc };
      String alias = null;
      X509Certificate cert = null;
      X509Certificate[] certChain;
      try
      {
         callbackHandler.handle(callbacks);
         alias = nc.getName();
         Object tmpCert = oc.getCredential();
         if (tmpCert != null)
         {
            if (tmpCert instanceof X509Certificate)
            {
               cert = (X509Certificate) tmpCert;
View Full Code Here

Examples of org.jboss.security.auth.callback.ObjectCallback

                PasswordCallback passwordCallback = (PasswordCallback) callbacks[i];
                passwordCallback.setPassword(keyPassword);
            }
            else if (callbacks[i] instanceof ObjectCallback)
            {
                ObjectCallback objectCallback = (ObjectCallback) callbacks[i];
                objectCallback.setCredential(authRequest.getCredentials());
            }
        }
    }
View Full Code Here

Examples of org.jboss.security.auth.callback.ObjectCallback

        assertOptions(options);
        assertCallbackHandler(callbackHandler);

        final NameCallback aliasCallback = new NameCallback("Key Alias: ");
        final PasswordCallback passwordCallback = new PasswordCallback("Key Password", false);
        final ObjectCallback objectCallback = new ObjectCallback("Certificate: ");

        try
        {
            // get information from caller
            callbackHandler.handle(new Callback[]{aliasCallback, passwordCallback, objectCallback});
View Full Code Here

Examples of org.jboss.security.auth.callback.ObjectCallback

            return true;
        }

        // Time to see if this is a delegation request.
        NameCallback ncb = new NameCallback("Username:");
        ObjectCallback ocb = new ObjectCallback("Credential:");

        try {
            callbackHandler.handle(new Callback[] { ncb, ocb });
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            }
            return false; // If the CallbackHandler can not handle the required callbacks then no chance.
        }

        String name = ncb.getName();
        Object credential = ocb.getCredential();

        if (credential instanceof ExternalCredential) {
            identity = new SimplePrincipal(name);
            loginOk = true;
            return true;
View Full Code Here

Examples of org.jboss.security.auth.callback.ObjectCallback

            return true;
        }

        // Time to see if this is a delegation request.
        NameCallback ncb = new NameCallback("Username:");
        ObjectCallback ocb = new ObjectCallback("Password:");

        try {
            callbackHandler.handle(new Callback[] { ncb, ocb });
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            }
            return false; // If the CallbackHandler can not handle the required callbacks then no chance.
        }

        String name = ncb.getName();
        Object credential = ocb.getCredential();

        if (credential instanceof CurrentUserCredential) {
            // This credential type will only be seen for a delegation request, if not seen then the request is not for us.

            final CurrentUserCredential cuCredential = (CurrentUserCredential) credential;
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.