001    package org.apache.geronimo.jetty;
002    
003    import java.io.IOException;
004    import java.security.Principal;
005    
006    import org.mortbay.http.Authenticator;
007    import org.mortbay.http.HttpRequest;
008    import org.mortbay.http.HttpResponse;
009    import org.mortbay.http.UserRealm;
010    
011    /**
012     * Authenticator that always denies, returning null.  Useful when you need to install a default principal/subject
013     * in an unsecured web app.
014     */
015    public class NonAuthenticator implements Authenticator {
016        public Principal authenticate(UserRealm realm, String pathInContext, HttpRequest request, HttpResponse response) throws IOException {
017            return null;
018        }
019    
020        public String getAuthMethod() {
021            return "None"; 
022        }
023    }