org.benow.web
Class RedirectingBasicAuthenticator

java.lang.Object
  extended by org.benow.web.RedirectingBasicAuthenticator
All Implemented Interfaces:
java.io.Serializable, org.mortbay.jetty.security.Authenticator

public class RedirectingBasicAuthenticator
extends java.lang.Object
implements org.mortbay.jetty.security.Authenticator

BASIC authentication. This is a redirecting authenticator, in that it redirects to specified pages as I could find no other way to do so. <andy@benow.ca>

Author:
Greg Wilkins (gregw)
See Also:
Serialized Form

Constructor Summary
RedirectingBasicAuthenticator()
           
 
Method Summary
 java.security.Principal authenticate(org.mortbay.jetty.security.UserRealm realm, java.lang.String pathInContext, org.mortbay.jetty.Request request, org.mortbay.jetty.Response response)
           
 java.lang.String getAuthMethod()
           
 void sendChallenge(org.mortbay.jetty.security.UserRealm realm, org.mortbay.jetty.Response response)
           
 void setErrorPage(java.lang.String page)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedirectingBasicAuthenticator

public RedirectingBasicAuthenticator()
Method Detail

authenticate

public java.security.Principal authenticate(org.mortbay.jetty.security.UserRealm realm,
                                            java.lang.String pathInContext,
                                            org.mortbay.jetty.Request request,
                                            org.mortbay.jetty.Response response)
                                     throws java.io.IOException
Specified by:
authenticate in interface org.mortbay.jetty.security.Authenticator
Returns:
UserPrinciple if authenticated or null if not. If Authentication fails, then the authenticator may have committed the response as an auth challenge or redirect.
Throws:
java.io.IOException

getAuthMethod

public java.lang.String getAuthMethod()
Specified by:
getAuthMethod in interface org.mortbay.jetty.security.Authenticator

sendChallenge

public void sendChallenge(org.mortbay.jetty.security.UserRealm realm,
                          org.mortbay.jetty.Response response)
                   throws java.io.IOException
Throws:
java.io.IOException

setErrorPage

public void setErrorPage(java.lang.String page)