-
1. Re: Context not passed between web tier and ejb tier
radl01 Oct 7, 2003 7:47 AM (in response to indusunil)You have to make new LoginContext in your JSP/Servlet tier and after that you can invoke methods in EJB container.
Regards
Jan -
2. Re: Context not passed between web tier and ejb tier
indusunil Oct 7, 2003 1:22 PM (in response to indusunil)This is the code. Looks like it is going to the Exception and it is printing the username is null
public static String getCallerName(EJBContext ctx)
{
logger.debug("In AuditHelper getCallerName entered");
String userName = null;
if (ctx != null)
{
try
{
logger.debug("In AuditHelper before ctx.getCallerPrincipal() ctx: " + ctx);
java.security.Principal principal = ctx.getCallerPrincipal();
logger.debug("In AuditHelper before principal.getName() principal: " + principal);
userName = principal.getName();
logger.debug("In AuditHelper after getCallerPrincipal().getName() userName: " + userName);
}
catch(Exception e)
{
logger.debug("In AuditHelper exception occurred: ");
}
}
else
{
logger.debug("In AuditHelper ctx is null.");
}
logger.debug("In AuditHelper returned userName: " + userName);
return userName;
}
below is my log:
AuditHelper.getCallerName sessionContext: org.jboss.ejb.StatelessSessionEnterpriseContext$SessionContextImpl@1af8109
2003-10-06 10:03:31,737 DEBUG [com.compuware.cis.util.application.ejb.security.AuditHelper] In AuditHelper getCallerName entered
2003-10-06 10:03:31,737 DEBUG [com.compuware.cis.util.application.ejb.security.AuditHelper] In AuditHelper before ctx.getCallerPrincipal() ctx: org.jboss.ejb.StatelessSessionEnterpriseContext$SessionContextImpl@1af8109
2003-10-06 10:03:31,753 DEBUG [com.compuware.cis.util.application.ejb.security.AuditHelper] In AuditHelper exception occurred:
2003-10-06 10:03:31,753 DEBUG [com.compuware.cis.util.application.ejb.security.AuditHelper] In AuditHelper returned userName: null
2003-10-06 10:03:31,753 DEBUG [EjbTier] In StartTargetSvcBean intiateTargeting Calling AuditHelper.getCallerName: null
Thanks,
Indu -
3. Re: Context not passed between web tier and ejb tier
radl01 Oct 8, 2003 12:31 AM (in response to indusunil) -
4. Re: Context not passed between web tier and ejb tier
indusunil Oct 16, 2003 3:09 PM (in response to indusunil)My case is little different. We have a tool to develop application which comes with Jboss and Tomcat. The getCallerPrincipal() method is returning the principal when we test the application inside the tool. When we try to deploy it in Jboss/Jetty it is not working and I am getting an exception No security context set. Please let me know whether I should do any configuration in the Jetty or in Jboss.
Thanks in advance,
Indu -
5. Re: Context not passed between web tier and ejb tier
juha Oct 20, 2003 5:49 AM (in response to indusunil)Describe your configuration in more detail, are you performing authentication at the servlet tier, what do you have configured for the webtier, what security constraints do you have for your servlet?
-- Juha