users@glassfish.java.net

Multiple login methods (gf 3.1)

From: CasMeiron <casmeiron_at_gmail.com>
Date: Wed, 1 Sep 2010 11:26:32 -0300

Hi guys,

I'm buildin' an application that must authenticate user using the follow
methods:

   - page form (using form authentication)
   - rest
   - WS

So, for the page form method I'm using the login-config, works well.

How can I provide the rest authentication on the same web app?

I've tried to create a web filter so I can return the response
with WWW-Authenticate header whether the user is not logged but
unfortunately I get java.lang.IllegalStateException
 at
org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:487)
when the server executes the line:

*resp.sendError(HttpServletResponse.SC_UNAUTHORIZED, "BLABLABLA");*

Any thoughts?

Thanks in advance.

-------------------------------
Paulo Reis