Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 93251 invoked from network); 22 Jun 2010 12:25:39 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jun 2010 12:25:39 -0000 Received: (qmail 54600 invoked by uid 500); 22 Jun 2010 12:25:36 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 54395 invoked by uid 500); 22 Jun 2010 12:25:32 -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 54386 invoked by uid 99); 22 Jun 2010 12:25:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 12:25:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.191.87.86] (HELO web37603.mail.mud.yahoo.com) (209.191.87.86) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 22 Jun 2010 12:25:26 +0000 Received: (qmail 93202 invoked by uid 60001); 22 Jun 2010 12:25:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1277209504; bh=0wTU9DCH17dd3iI+PSPESaBEfWFlDF8obpOSZAHX/nI=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=g6bQ2vZHFmwcV+viX/RwTVjvF6/35hZdKA27PkfiGCIHUjcU8OU3kHeAFziDudqj9DIOxrs1wnhZtPr81BEljO1gBjddEQ6a5pKUVKzcXOoLF6vZ6bZ0ny15vQeYjC3OR2z6/ccNUMNQlutU5OV9sNBXZE5mkO4aYXo4uZXDFeA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=bYGeDHdSREq9dvWRRiOi+7HYVfTTZCoU61+VnuN1TKeIbmVdJ6Dm15CPPrMcnXWkECVLju68ZLKXMcvNL46L4XkCkYvaMmCOIBBjbFNwk9TltiM5Q16+kQ7gKgMT1pD+LFvw8X+Dx6rXnzmcN5Jn00HZPwCzXTuCEK4NhJagTlE=; Message-ID: <564628.92870.qm@web37603.mail.mud.yahoo.com> X-YMail-OSG: ZzP2Wh4VM1msWob0vY2eBjB2PlytsbN4tmRz6Q6oG6f5Q3v y1Poo6Wfd6pIWFj8rUCGbQtFGdT0gDcGmlPcX4ivpUt2QT_o0VpWuGwDdzyT uub2EsEgl5LjHOSaCe7uQSa7Z5qaqzpxWM0phGv_l5RKOlgnqRGP9JRUgR.7 cWvyt0ZfTje3mK8WToikeS9ntIOfmQei7eiP2UkVNAN.JyBj6xBZbLBFKMLv 71SWURDpn20dTaMO6Kp1SuEUqDOWgZ1IGAZglcs5FrzO8xroOWYW_MFHviSh 0Ww0Id5Pap6bUdZA- Received: from [85.9.14.242] by web37603.mail.mud.yahoo.com via HTTP; Tue, 22 Jun 2010 05:25:04 PDT X-Mailer: YahooMailRC/397.8 YahooMailWebService/0.8.103.269680 References: <984110.67307.qm@web37607.mail.mud.yahoo.com> <4C10ECA8.8050000@christopherschultz.net> <618532.91164.qm@web37605.mail.mud.yahoo.com> <4C113E94.8070807@apache.org>,<7989.94086.qm@web37601.mail.mud.yahoo.com> <146741.84145.qm@web37602.mail.mud.yahoo.com> <4C1F7768.5080908@pidster.com> <46625.14928.qm@web37606.mail.mud.yahoo.com> <4C1F8310.8020308@pidster.com> <137104.27696.qm@web37604.mail.mud.yahoo.com> <4C1F98D8.7060501@pidster.com> Date: Tue, 22 Jun 2010 05:25:04 -0700 (PDT) From: neo21 zerro Subject: Re: HTTP Status 408! To: Tomcat Users List , pid@pidster.com In-Reply-To: <4C1F98D8.7060501@pidster.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1848553297-1277209504=:92870" --0-1848553297-1277209504=:92870 Content-Type: text/plain; charset=us-ascii Can you provide a hint on how to perform automatic login using BASIC authentication? Or can I somehow modify the class FormAuthenticator? and tell Tomcat to use my custom class.... Thanks! ________________________________ From: Pid To: Tomcat Users List Sent: Mon, June 21, 2010 7:52:40 PM Subject: Re: HTTP Status 408! On 21/06/2010 17:36, neo21 zerro wrote: > > > Ok. Something like this ? > > > > URL protectedResource = new URL("http://localhost:8080/resource"); > *URLConnection yc = *protectedResource*.openConnection();* > BufferedReader in = new BufferedReader( > new InputStreamReader( > *yc.getInputStream()*)); > String inputLine; > > while ((inputLine = in.readLine()) != null) > //check if the response is the login page > in.close(); > > if(The response is login page){ > > > //make another request with to specific params for the authentication > } It's actually much easier to use BASIC auth if a machine is logging in. Look at: http://hc.apache.org/ > My question is that in the second request I need to open a browser so is the session id of the > first request the same with the session id of the second request? because the FormAuthenticator need's > the session id of the first request to retrieve the protected resource? Yes, the session id will be required. If the URLs are encoded properly as per previous discussion, then the form action attribute will be re-encoded to incorporate the session id - you'll see how to submit to a modified URL if you examine the returned HTML for the login form. p > ------------------------------------------------------------------------ > *From:* Pid > *To:* Tomcat Users List > *Sent:* Mon, June 21, 2010 6:19:44 PM > *Subject:* Re: HTTP Status 408! > > On 21/06/2010 15:48, neo21 zerro wrote: >> Ok.I already have send params from my other application to my >> Tomcat application and everything goes well, I make this with the >> j_security_check on a post method, and I track down the path with the >> debug log. The problem is that in the >> org.apache.catalina.authenticator.FormAuthenticator in the authenticate >> method the user is getting authenticated but when the user should be >> redirected to the initial saved request, null is returned. >> So my problem is that I make */programmaticaly >> > > > /*just >> a request to my Tomcat web app authenticating the user per user params >> but I need somehow to tell the FormAuthenticator what the saved request >> should be. Any ideas? > > The process is: > > 1. make a request for a protected resource > 2. check the response is what you want, > > 3. if it's not, but contains a login form > 4. submit username & password against form url > > > FormAuthenticator creates the saved request at step 1. > > > p > >> Thanks!!! >> >> ------------------------------------------------------------------------ >> *From:* Pid > >> *To:* Tomcat Users List > >> *Sent:* Mon, June 21, 2010 5:30:00 PM >> *Subject:* Re: HTTP Status 408! >> >> On 21/06/2010 15:20, neo21 zerro wrote: >>> Hello, >>> >>> Problem finally solved :) Pid was right my encoding was not ok and a >> Cookie was not passed over with the poste of the login page :) I needed >> to explicity create a servlet and in that servler add to the response >> object the JSSESIONID as a Cookie :) >>> >>> I have another question can I login from another aplication >> programmicaly to my app that runs on Tomcat with custom JAAS login module? >> >> If the other app knows how to perform whatever custom JAAS login you've >> built, then I don't see why not. >> >> >> p >> >>> ________________________________ >>> From: Martin Gainty > >> >>> To: Tomcat Users List >> >> >>> Sent: Fri, June 11, 2010 11:16:09 PM >>> Subject: RE: HTTP Status 408! >>> >>> >>> can you post all of the code (including the html that houses the flex >> components), display the full stacktrace and display environmental >> variables from SET >>> >>> Martin >>> ______________________________________________ >>> standard caveats apply >>> >>> >>> >>> >>> >>>> Date: Fri, 11 Jun 2010 12:32:44 -0700 >>>> From: neo21_zerro@yahoo.com > > >>>> Subject: Re: HTTP Status 408! >>>> To: users@tomcat.apache.org > > >>>> >>>> >>>> >>>> >>>> >>>> I installed the Tomcat 7 RC but the problem persists. >>>> So it's definitely a bug from my app. After the logout is made the >> redirect is made from flex(navigateToUrl - function) do you think this >> could be an issue? >>>> >>>> >>>> >>>> >>>> ________________________________ >>>> From: Mark Thomas > >> >>>> To: Tomcat Users List >> >> >>>> Sent: Thu, June 10, 2010 10:35:48 PM >>>> Subject: Re: HTTP Status 408! >>>> >>>> On 10/06/2010 15:39, neo21 zerro wrote: >>>>> >>>>> Yes I am requesting a protected resource but I don't know why is >> this happening. >>>>> >>>>> >>>>> I've tried to set all sort of cookies in my browser but nothing >> works.....The problem is that I'm not using jsp like Pid said >>>>> and I think I should try to use jsp...for my login page. >>>>> Are there other versions of Tomcat ? I mean newer versions, like 7 ? >>>> >>>> That assumes a) there is a bug in Tomcat and b) that it is fixed in a >>>> newer version of 6.0.26. >>>> >>>> I have yet to see any evidence in this thread that there is a bug in >> Tomcat. >>>> >>>> Mark >>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >> > >>>> For additional commands, e-mail: users-help@tomcat.apache.org > >> > >>>> >>>> >>>> >>> >>> _________________________________________________________________ >>> The New Busy think 9 to 5 is a cute idea. Combine multiple calendars >> with Hotmail. >>> > http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 > > > >>> >>> >>> >> >> >> > > > --0-1848553297-1277209504=:92870--