camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manchandap <manchan...@yahoo.com>
Subject Re: Apache Camel v2.12 | CXF Component | Basic Authentication | Web Service
Date Fri, 24 Jan 2014 07:27:58 GMT
Was able to get this working by adding the following code to the Route
Builder. I am using Java DSL:

	Map<String, Object> properties = new HashMap<String, Object>(); 

		AuthorizationPolicy authPolicy = new AuthorizationPolicy(); 
		authPolicy.setAuthorizationType(HttpAuthHeader.AUTH_TYPE_BASIC); 
		authPolicy.setUserName(USERNAME); 
		authPolicy.setPassword(PWD); 
		authPolicy.setAuthorization("true");
		
		//properties.put(AuthorizationPolicy.class.getName(), authPolicy);
	
properties.put("org.apache.cxf.configuration.security.AuthorizationPolicy",
authPolicy);
		
		CxfEndpoint myCxfEp = (CxfEndpoint)getContext().getEndpoint("cxf://");
	        myCxfEp.setProperties(properties);

Thanks and Regards
P Manchanda




--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-v2-12-CXF-Component-Basic-Authentication-Web-Service-tp5746233p5746435.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message