All:
      I have been looking at some of the example with *secure* on their
names and I am unable to find any example that shows how to authenticate
users using LDAP.  I am specifically talking about the CallBack Handler
classes found in the calculator-ws-secure-webapp sample.  In the
ServerPWCBHandler uses a very simple password check.  Could anyone
elaborate on how one could authenticate against the configured back end in
the J2EE container?  In my case this is an LDAP server.  Also my
requirements dictate I need to create a LTPA token.  I will be deploying
this implementation in WAS 7.0.0.1.  Any links or hints will be greatly
appreciated.



public class ServerPWCBHandler implements CallbackHandler {



    public void handle(Callback[] callbacks) throws IOException,

            UnsupportedCallbackException {

      for (int i = 0; i < callbacks.length; i++) {

            System.out.println("*** Calling Server User/Passwd
Handler....");

            WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];...

            System.out.println("User Id = " + pwcb.getIdentifer());

            System.out.println("Password = " + pwcb.getPassword());

            System.out.println("Usage = " + pwcb.getUsage());

            if ( pwcb.getUsage() ==
WSPasswordCallback.USERNAME_TOKEN_UNKNOWN ) {

                if ( pwcb.getIdentifer().equals("CalculatorUser") &&

                        pwcb.getPassword().equals
("CalculatorUserPasswd") ){

                            return;

                } else {

                    throw new UnsupportedCallbackException(pwcb,
"Authentication Failed : UserId - Password mismatch");

                }

            } else if ( pwcb.getUsage() == WSPasswordCallback.SIGNATURE ) {

                if ( pwcb.getIdentifer().equals("CalculatorUser")) {

                    pwcb.setPassword("CalculatorUserPasswd");

                } else {.

                    pwcb.setPassword("CalculatorAdmin");

                }

            }

        }

    }



}




Angel E. Tomala-Reyes
IBM Corporation, Enterprise Initiatives
Cloud Computing Enablement
Software Engineer
15038 Union Turnpike 8F
Flushing, NY 11367
1-877-564-9244 (T/L:3208066)

Reply via email to