Hi
I am trying to call secured
EJB from stanalone client.
Here is my code:
lc = new LoginContext("ClientContainer", new WSCallbackHandlerImpl("admin","whatever"));
lc.login();
System.out.println(lc.getSubject());
com.ibm.websphere.security.auth.WSSubject.setRunAsSubject(lc.getSubject());
com.ibm.websphere.security.auth.WSSubject.doAs(lc.getSubject(), new PrivilegedAction() {
public Object run() {
try {
List l = SecurityAdapter.getBusinessUnitsForExtend();
System.out.println(l);
} catch (SecurityServiceException e) {
e.printStackTrace();
}
return null;
}
});
Its able to authenticate but when I call getCallerPrincipal at EJB side. it fails to get my Custom Principal and it gets Unauthenticated.
Can anyone please help me.
Thanks
Narayanan