Hi Oleg, Thank you for your response. I realized my issue last night with my scheme not implementing challenge. I've been developing an implementation of Amazon S3 authentication which requires no challenge. I didn't realize that there was a difference until I started reading more carefully about preemptive auth schemes. By setting up my scheme as preemptive I was able to get it to work.
On a side note if the project is interested in having an Amazon S3 auth implementation I'd be happy to submit it. Jean-Philippe On Fri, Mar 12, 2010 at 10:34 AM, Oleg Kalnichevski <[email protected]>wrote: > 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<String> authpref = new ArrayList<String>(); >> 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: [email protected] > For additional commands, e-mail: [email protected] > >
