hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x8nnn <rangeli.ne...@gmail.com>
Subject Authorization Header
Date Sat, 10 Apr 2010 23:32:33 GMT

Hello Everybody,

Recently I inherited a application built on top of httpclient ( written with
httpclient 3)  that communicate with server using ssl client auth. 

Now we want to add a feature to add a Authorization header having custom
scheme and value. ie.
Authorization: Custom customValue= <Some string>


 I am not sure what exactly we need to do from httpclient perspective. Any
help will be highly appreciated.

I did try to  creatte customCredential and AuthScheme.  But unfortunately it
does not create any authorization header. I have set preemptive
Authentication

httpClient.getParams().setAuthenticationPreemptive(true);

AuthPolicy.registerAuthScheme(FooAuthScheme.NAME, 
	                DeceAuthScheme.class);
List authPrefs = new ArrayList(1);
	        authPrefs.add(AuthPolicy.getAuthScheme(FooAuthScheme.NAME));
	     
	        params.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
	        InflateEncode iEncode=new InflateEncode(true);
		      String encodedString=iEncode.getEncodeString();
		      
		     httpClient.getState().setCredentials(new AuthScope("myhost", 8080,
AuthScope.ANY_REALM), new
		        		FooCredentials(encodedString)) ;

Thank you.
rn 
-- 
View this message in context: http://old.nabble.com/Authorization-Header-tp28205527p28205527.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message