On the scenario you are describing, using a CallBack to handle the authentication, you could easily use an LDAP API [1] to perform the authentication/authorization. As for LTPAToken, if you are handling things yourself, you will need to find specific WebSphere APIs to handle that.
Does that help ? [1] http://java.sun.com/products/jndi/tutorial/ldap/security/ldap.html On Mon, Mar 9, 2009 at 8:42 AM, Angel E Tomala Reyes <[email protected]> wrote: > 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) -- Luciano Resende Apache Tuscany, Apache PhotArk http://people.apache.org/~lresende http://lresende.blogspot.com/
