Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://localhost:2809");
Context initialContext = new InitialContext(env);
java.lang.Object obj = initialContext.lookup("");
LoginContext lc1 = null;
lc1 = new LoginContext("MyLogin1",
new WSCallbackHandlerImpl("user1", "MyLogin1","pass1") );
lc1.login();
Subject as1= lc1.getSubject();
this code only looks for login modules at the client side. what i need is server login modules to be invoke from there. is there anything that i can write in client side login module which invokes server login module (for example: Authenticate.authenticate() in weblogic or security interceptor in jboss)
or is it some different mechanism in websphere?
What is the target realm name that we specify in Callbackhanler? does it have significance? because this is what is there inside the constructors of WSCallbackhandlerImpl
public WSCallbackHandlerImpl(
String s, String s1)
{
if(tc.isEntryEnabled())
Tr.entry(tc, "WSCallbackHandlerImpl(userName = \"" + s + "\", password = \"********\")");
userName = s;
password = s1;
if(tc.isEntryEnabled())
Tr.exit(tc, "WSCallbackHandlerImpl(userName, password)");
}
public WSCallbackHandlerImpl(String s, String s1, String s2)
{
this(s, s2);
}