Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 36706 invoked from network); 1 Apr 2002 06:35:46 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 1 Apr 2002 06:35:46 -0000 Received: (qmail 22824 invoked by uid 97); 1 Apr 2002 06:35:36 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 22791 invoked by uid 97); 1 Apr 2002 06:35:35 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 22780 invoked from network); 1 Apr 2002 06:35:34 -0000 Date: Sun, 31 Mar 2002 22:35:28 -0800 From: Aditya To: tomcat-user@jakarta.apache.org Subject: programmatic way to invoke authentication? Message-ID: <20020401063528.GA33844@mighty.grot.org> Reply-To: Aditya Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-PGP-Key: http://www.grot.org/pubkey.asc X-PGP-Key-ID: 0x6405D8D5 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Is there a programmatic way to force a user to authenticate without using a security-constraint in web.xml? It seems like I should be able to do something like: String myremotename = request.getRemoteUser(); if (myremotename == null){ LoginConfig myconfig = new LoginConfig(); myconfig.setAuthMethod("FORM"); myconfig.setErrorPage("/admin/error.html"); myconfig.setLoginPage("/admin/Login"); myconfig.setRealmName("My Login"); if (authenticate(request, response, myconfig)){ return; } } else { out.println("username: " + myremotename + "
"); } but needless to say, that doesn't work -- I've been through the javadocs and source and can't figure it out. hints? Thanks, Adi -- To unsubscribe: For additional commands: Troubles with the list: