On Sun, 2005-03-06 at 20:47 -0500, Darren Govoni wrote:

> Thanks Chuck. This approach works better, although I would think
> regardless of the auth form, the redirect to error
> page would be independent.
> 
> Any idea how to do FORM based auth from a Java client?
> 
> I was using Basic like this:

            String credentials = u+":"+p;
            //System.out.println(credentials);            
            String encoding = new sun.misc.BASE64Encoder().encode
(credentials.getBytes());

           
            URLConnection uc = descURL.openConnection();
            uc.setRequestProperty  ("Authorization", "Basic " +
encoding);  
            InputStream descIS = uc.getInputStream();


> 
> 
> On Sun, 2005-03-06 at 17:04 -0800, Chuck Williams wrote:
> 
> > Darren Govoni writes (3/6/2005 3:27 PM):
> > 
> > >I only want it to forward to <error-page> on a code 401 _when the login
> > >attempt fails_ and it should prompt the user for that, which it doesn't.
> > >  
> > >
> > Oh, this is for a login error?  I use FORM authentication which provides 
> > a form-error-page in the form-login-config.  This is triggered for 
> > authentication errors.  I use separate error-page's for related errors 
> > like a session-timeout while the user is on the login page (which 
> > generates a 408).  However, I don't believe the error-page mechanism 
> > works for authentication errors, which is probably  your issue with 
> > BASIC authentication.  How about switching to FORM authentication so you 
> > have more control?  Then you shouldn't have any issues (although it is 
> > still a war path and not a url...)..
> > 
> > Chuck
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to