• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

IBM/Websphere 5.0 JAAS problem with context

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
narayans40,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

Thanks Pardner! Hope to see you 'round the Ranch!
 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic