On Sep 23, 2005, at 10:55 AM, lin sun wrote:

Thanks so much for your help!!   I made some progress!!:-)

The geronimo application plan below is extremely helpful and I was able to deploy the new
plan with only one change (org/apache/geronimo/ClientCORBA ->
org/apache/geronimo/ClientCorba).

I got the following error when I tried to start the client. I think it is because I don't have the org.acme.UPCallbackHandler in place yet. Is there an example or
documentation of this UPCCallbackHandler?

You have to write it:-)

Something like this should work, I've hardcoded the user/pw. For a real app you would want to get them from the user with a gui or something or get them from the command line.

package org.acme;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.callback.UnsupportedCallbackException;

public class UPCallbackHandler implements CallbackHandler {

    private final String userName = "system";
    private final char[] password = "manager";

public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            if (callbacks[i] instanceof PasswordCallback) {
                ((PasswordCallback) callbacks[i]).setPassword(password);
            } else if (callbacks[i] instanceof NameCallback) {
                ((NameCallback) callbacks[i]).setName(userName);
            }
        }
    }

}

You are about to get the the point where the missing security gbeans on the app client will block progress. I have been hoping for several days to put a plan for these together but have not had time yet. Perhaps today will be the day.

thanks
david jencks

Reply via email to