Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 80975 invoked from network); 10 Jan 2011 19:43:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Jan 2011 19:43:00 -0000 Received: (qmail 38070 invoked by uid 500); 10 Jan 2011 19:42:53 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 37946 invoked by uid 500); 10 Jan 2011 19:42:53 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 37822 invoked by uid 99); 10 Jan 2011 19:42:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jan 2011 19:42:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cogross@gmail.com designates 74.125.82.43 as permitted sender) Received: from [74.125.82.43] (HELO mail-ww0-f43.google.com) (74.125.82.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jan 2011 19:42:46 +0000 Received: by wwi17 with SMTP id 17so20333754wwi.0 for ; Mon, 10 Jan 2011 11:42:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=LidD/HMCZRfPAauGFZ2kNE7WRR1DlS/hPrVGSJUtako=; b=wkBtm0zi1bGMs3gAhg2jkiSuF4fzSR9vO/yQTtnVPdx4oy+UxuAUbG6LGZd3clyH3I bSXXaaH1QZAmKJufu9ouSBwS6vBHeR8YBtRtxUOetCMDp6Vq1/wBhktV5yGk6xWk3qbb utmfF5UuCgvJegx8/73HRuDdjJvdB9xVKhRZ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=aKpuvjiaqFtocw/cLgpMy8QhEsKcTnOa2172IQVOgv9mPOC2aVd8bRbQiHUIpicwGt TmBLW/6d+oaZz8+ay/azgKlOzggHEJf7mQQkZcH+jKNmpOlxUzGn+N2FiQx+36pvV04i gaqRAiX07VndtcUkCSuKzErIRMUueieS5Ziro= Received: by 10.216.156.149 with SMTP id m21mr2186276wek.22.1294688499495; Mon, 10 Jan 2011 11:41:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.167.195 with HTTP; Mon, 10 Jan 2011 11:41:19 -0800 (PST) In-Reply-To: <4D2B5B9F.4090308@pidster.com> References: <4D277DC7.4090909@pidster.com> <4D279702.4010705@pidster.com> <4D2B404C.4030906@pidster.com> <4D2B4650.3050505@pidster.com> <4D2B5205.60201@apache.org> <4D2B53C5.9030108@apache.org> <4D2B5B9F.4090308@pidster.com> From: Christopher Gross Date: Mon, 10 Jan 2011 14:41:19 -0500 Message-ID: Subject: Re: Configuring Embedded Tomcat To: Tomcat Users List Content-Type: multipart/alternative; boundary=001485f454181b757904998328e1 X-Virus-Checked: Checked by ClamAV on apache.org --001485f454181b757904998328e1 Content-Type: text/plain; charset=ISO-8859-1 That did it! Thanks Mark & Pid. Now to make it more complicated -- in order to have another page without that restriction, would I need to make a whole new webapp, or can I turn down the security for a specific page? Thanks! -- Chris On Mon, Jan 10, 2011 at 2:18 PM, Pid wrote: > On 1/10/11 6:58 PM, Christopher Gross wrote: > > Borrowing from another web.xml (solr's), I added this to my web.xml: > > > > > > > > Link to the UserDatabase instance from which we request lists of > > defined role names. Typically, this will be connected to the > global > > user database with a ResourceLink element in server.xml or the > context > > configuration file for the Manager web application. > > > > users > > > > org.apache.catalina.UserDatabase > > > > > > > > > > > > Monitor > > /Monitor/* > > GET > > POST > > > > > > admin > > > > > > > > > > > > BASIC > > UserDatabase > > > > > > > > admin > > > > > > But I'm still getting through without having to authenticate. Is there > > something that I'm missing, or am I going about this all wrong? > > If 'Monitor' is the name of your Context/webapp, the above means: > > /Monitor/Monitor/* > > Try: > > /* > > instead. > > > p > > > > > Thanks! > > > > -- Chris > > > > > > On Mon, Jan 10, 2011 at 1:45 PM, Mark Thomas wrote: > > > >> On 10/01/2011 18:43, Christopher Gross wrote: > >>> I added the security role: > >>> MemoryRealm mr = new MemoryRealm(); > >>> mr.setPathname(path + "/conf/tomcat-users.xml"); > >>> Context sp = embedded.createContext("/Monitor", path + > >>> "/webapps/monitor"); > >>> sp.setRealm(mr); > >>> sp.addSecurityRole("admin"); > >>> host.addChild(sp); > >>> > >>> Is there anything else that I need to do for the Context? > >> > >> You need to set up some security constraints in web.xml > >> > >> Mark > >> > >>> > >>> -- Chris > >>> > >>> > >>> On Mon, Jan 10, 2011 at 1:37 PM, Mark Thomas wrote: > >>> > >>>> On 10/01/2011 18:16, Christopher Gross wrote: > >>>>> I created a MemoryRealm object, pointed it to my tomcat-users.xml > file, > >>>>> added that realm to the embedded (no luck) and to the specific > context > >>>> (no > >>>>> luck either). For both, it just plain loads the page -- doesn't ask > me > >>>> to > >>>>> do any type of logging in. > >>>>> > >>>>> Are you just using your own experience to help me, or are you aware > of > >>>> any > >>>>> documentation that I could peruse, instead of lobbing questions at > you > >> a > >>>> few > >>>>> times a day? :) > >>>> > >>>> Have you configured your app to require authentication? IF not the > realm > >>>> will never be used. > >>>> > >>>> Mark > >>>> > >>>>> > >>>>> -- Chris > >>>>> > >>>>> > >>>>> On Mon, Jan 10, 2011 at 12:48 PM, Pid wrote: > >>>>> > >>>>>> Can you not create a org.apache.catalina.realms.MemoryRealm and set > >> the > >>>>>> path to the xml file? > >>>>>> > >>>>>> > >>>>>> p > >>>>>> > >>>>>> > >>>>> > >>>> > >>>> > >>>> --------------------------------------------------------------------- > >>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >>>> For additional commands, e-mail: users-help@tomcat.apache.org > >>>> > >>>> > >>> > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >> For additional commands, e-mail: users-help@tomcat.apache.org > >> > >> > > > > --001485f454181b757904998328e1--