Hi Setanta,

Could you post server log?
We need more detail to understand what's going on.

In article <[EMAIL PROTECTED]>,
Thu, 18 Nov 2004 13:25:02 -0000,
Setanta Mathews <[EMAIL PROTECTED]> wrote: 
smathews> The authentication must be working. Part of the test in question 
calls an
smathews> EJB that does the following check:
smathews> 
smathews> principal = sessionContext.getCallerPrincipal();
smathews> name = principal.getName();
smathews> System.out.println("User Id: " + name);
smathews> if (name.equals("anonymous") || name.equals("guest"))
smathews>       throw new PrincipalException("Principal must be authenticated");
smathews> 
smathews> Without the begin method in my test the principal name is "guest" and 
a
smathews> PrincipalException will be thrown. With the begin method the 
principal name
smathews> is "0" (so authentication must have happened) and no exception is 
thrown.

If the purpose of the authentication is to get a principal name,
and you think the FormAuthentication goes worng,
you might try to use the BasicAuthentication for your unit-testing of EJBs.


smathews> I agree that setting the expected response code to 500 is dangerous 
smathews> but I can't spend too much more time trying to get my tests running.

I don't think that is a good idea.
It may take long time to solve your problem with FormAuthentication,
but it cannot be a reason to bypassing the problem by such unusual approach.

I suggest you to use more simple authentication for your tests.

Regards,
----
Kazuhito SUGURI
mailto:[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to