Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 81020 invoked from network); 12 Mar 2010 18:35:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Mar 2010 18:35:40 -0000 Received: (qmail 29524 invoked by uid 500); 12 Mar 2010 18:35:02 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 29499 invoked by uid 500); 12 Mar 2010 18:35:02 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 29491 invoked by uid 99); 12 Mar 2010 18:35:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Mar 2010 18:35:02 +0000 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=KHOP_SC_TOP_CIDR8,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [92.42.190.144] (HELO ok2cons2.nine.ch) (92.42.190.144) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Mar 2010 18:35:00 +0000 Received: from [192.168.1.101] (77-58-241-174.dclient.hispeed.ch [77.58.241.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id EFEAA4BA2BC for ; Fri, 12 Mar 2010 19:34:38 +0100 (CET) Message-ID: <4B9A8939.2070107@apache.org> Date: Fri, 12 Mar 2010 19:34:33 +0100 From: Oleg Kalnichevski User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: HttpClient User Discussion Subject: Re: Custom AuthScheme References: <4ea6a40a1003111645k3071a854u85496a113faab01a@mail.gmail.com> In-Reply-To: <4ea6a40a1003111645k3071a854u85496a113faab01a@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Jean-Philippe Steinmetz wrote: > Hello everyone, > > I'm currently working with httpclient 4.1.alpha1 and am trying to create a > custom authorization scheme. I've got the scheme all coded up but i'm having > trouble actually getting it to execute with the client. > > Here's how I am registering the scheme/creds to the client. > > httpclient.getAuthSchemes().register("CUSTOM", new CustomSchemeFactory()); > List authpref = new ArrayList(); > authpref.add("CUSTOM"); > httpclient.getParams().setParameter(AuthPNames.TARGET_AUTH_PREF, authpref); > httpclient.getCredentialsProvider().setCredentials(AuthScope.ANY, new > UsernamePasswordCredentials(username, password)); > > I have System.out messages all throughout my code including in the > SchemeFactory.newInstance function and i'm not getting any output when I > run. I can also confirm this even with a debugger. So what exactly am I > doing wrong here? > I see nothing wrong with your code. However, if the server does not challenge the client with a auth request that includes CUSTOM scheme, the client-side auth scheme will never get executed. > Also, is it possible to spit out the request, in it's entirety, right before > it's actually sent to the server? It would be greatly helpful in debugging > communication with the server. > Certainly. See http://hc.apache.org/httpcomponents-client/logging.html Oleg > Cheers, > > Jean-Philippe Steinmetz > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org