You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Müller <ch...@gmail.com> on 2012/07/17 20:09:53 UTC

camel-cxf and HTTP BASIC authentication

We are in the process of migrating an existing project to Camel.
One of the requirements is to support HTTP BASIC authentication.
What's the (easiest) way to do this?

I thought this could be done by configuring Jetty (in jetty.xml) but didn't
found an example which doesn't use a web.xml file to fulfill this.
Afterwards, I was looking for an CXF (Inbound) Interceptor to do it. Again
without look. :-(
Is it really required to write my own Interceptor to support this standard?

We are using ServiceMix 4.4.1 with Camel 2.8.0.

Thanks in advance,
Christian

Re: camel-cxf and HTTP BASIC authentication

Posted by Daniel Kulp <dk...@apache.org>.
Are you using a pax-web based endpoint (address like "/foo") or a full CXF 
controlled Jetty port? (http://0.0.0.0:8080/foo)

For the former, you'd have to look into how you can configure the pax-web 
stuff.  I'm not really sure.

For the latter, you would need to configure stuff into the jetty instance.  
You can use one of the CXF system tests as an example:

http://svn.apache.org/repos/asf/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/

See the jettyBasicAuthServer.xml  and jetty-realm.properties files as 
examples.   That said, not sure how will that would work in OSGi.

Dan



On Tuesday, July 17, 2012 11:30:29 PM Christian Müller wrote:
> Thanks Yogesh for taking time for my question.
> 
> The information in [1] only helps for the client site (unit testing), but
> I have to provide this service (the server part).
> The information in [2] and [3] are useful how to implement such kind of
> CXF interceptor, but I still hope there is an existing solution in CXF or
> Jetty which doesn't force me to implement this. May be only a simple
> PasswordCallback or so...
> 
> [1]
> http://cxf.apache.org/docs/client-http-transport-including-ssl-support.htm
> l [2]
> http://chrisdail.com/2008/03/31/apache-cxf-with-http-basic-authentication/
> [3]
> http://chrisdail.com/2008/08/13/http-basic-authentication-with-apache-cxf-
> revisited/
> 
> Best,
> Christian
> 
> On Tue, Jul 17, 2012 at 9:45 PM, ychawla 
<pr...@yahoo.com>wrote:
> > Hi Christian,
> > What about adding an HTTP Conduit to your CXF bean?
> > 
> > http://cxf.apache.org/docs/client-http-transport-including-ssl-support.h
> > tml
> > 
> > Is your requirement for inbound or outbound HTTP basic auth?  Depending
> > on your container, you might be able to do this at the Apache HTTPD or
> > Tomcat layer as well.
> > 
> > Thanks,
> > Yogesh
> > 
> > --
> > View this message in context:
> > http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authenticatio
> > n-tp5716163p5716169.html Sent from the Camel - Users mailing list
> > archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Re: camel-cxf and HTTP BASIC authentication

Posted by Christian Müller <ch...@gmail.com>.
${fromCxfEndpointUri.port} is resolved with the port number this service is
using.

Regarding your issue: org.xml.sax.SAXParseException:
cvc-datatype-valid.1.2.3: '{
http://es0sreao:8181/mes/bw/MEStoBW_CopperRecoveryPercentage_JAAS}.8181' is
not a valid value of union type 'ParameterizedInt'.

use <httpj:engine port="8181">

instead of <httpj:engine port="{
http://es0sreao:8181/mes/bw/Service_Endpoint}.8181">


And as Claus said, you should make sure you use the same Jetty version as
your Karaf/ServiceMix/Camel. You may have to change the package names, if
they are renamed in a newer version. My code is working with Camel 2.8.x
(which is using Jetty 7.4.x) in ServiceMix 4.4.x (which is using Karaf
2.2.x).

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Thu, Sep 5, 2013 at 8:44 AM, contactreji <co...@gmail.com> wrote:

> Hi Christian
>
> I have followed your steps and made my coade as follows
>
> *
>         <cxf:cxfEndpoint id="MESEndpoint"
>                 address="http://server:8181/mes/bw/Service_Endpoint"
>
> serviceClass="company.pi.mes.id56.copperrecovery.ImplementationClass"
>                 wsdlURL="wsdl/myWSDL.wsdl"
>                 serviceName="p1:ServiceClasses"
> endpointName="p1:HTTPS_Port"
>                 xmlns:p1="urn:company:pi:mes:id56:Task"
>              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
>
>
>
>         <httpj:engine-factory>
>                 <httpj:engine
>                         port="{
> http://es0sreao:8181/mes/bw/Service_Endpoint}.8181">
>                         <httpj:tlsServerParameters>
>                                 <sec:keyManagers keyPassword="fuseesb">
>                                         <sec:keyStore type="JKS"
> password="fuseesb"
>
> file="certs/truststore.jks" />
>                                 </sec:keyManagers>
>                                 <sec:trustManagers>
>                                         <sec:keyStore type="JKS"
> password="fuseesb"
>
> file="certs/truststore.jks" />
>                                 </sec:trustManagers>
>                                 <sec:cipherSuitesFilter>
>                                         <sec:include>.*.*</sec:include>
>                                         <sec:exclude>.*40_.*</sec:exclude>
>
> <sec:exclude>.*_RSA_WITH_DES_CBC_SHA.*</sec:exclude>
>
> <sec:exclude>.*_RSA_WITH_3DES_EDE_CBC_SHA.*</sec:exclude>
>                                 </sec:cipherSuitesFilter>
>                                 <sec:clientAuthentication want="false"
>                                         required="false" />
>                         </httpj:tlsServerParameters>
>                         <httpj:threadingParameters minThreads="5"
>                                 maxThreads="20" />
>                         <httpj:handlers>
>
>                                 <ref bean="securityHandler" />
>                         </httpj:handlers>
>                 </httpj:engine>
>         </httpj:engine-factory>
>
>         <bean id="securityHandler"
> class="org.eclipse.jetty.security.ConstraintSecurityHandler">
>                 <property name="authenticator">
>                         <bean
> class="org.eclipse.jetty.security.authentication.BasicAuthenticator" />
>                 </property>
>                 <property name="constraintMappings">
>                         <list>
>                                 <bean
> class="org.eclipse.jetty.security.ConstraintMapping">
>                                         <property name="constraint">
>                                                 <bean
> class="org.eclipse.jetty.http.security.Constraint">
>                                                         <property
> name="name" value="BASIC" />
>                                                         <property
> name="roles" value="our-role-name" />
>                                                         <property
> name="authenticate" value="true" />
>                                                 </bean>
>                                         </property>
>                                         <property name="pathSpec"
> value="/*" />
>                                 </bean>
>                         </list>
>                 </property>
>                 <property name="loginService">
>                         <bean
> class="org.eclipse.jetty.plus.jaas.JAASLoginService">
>                                 <property name="name" value="karaf" />
>                                 <property name="loginModuleName"
> value="karaf" />
>                                 <property name="roleClassNames">
>                                         <list>
>
>
> <value>org.apache.karaf.jaas.modules.RolePrincipal</value>
>                                         </list>
>                                 </property>
>                         </bean>
>                 </property>
>                 <property name="strict" value="false" />
>                 <property name="identityService">
>                         <bean
> class="org.eclipse.jetty.security.DefaultIdentityService" />
>                 </property>
>         </bean>*
>
>
> While deployment I am getting following exception in log
>
> *
> 09:34:15,721 | INFO  | xtenderThread-36 | XmlBeanDefinitionReader
>  |
> 105 - org.springframework.beans - 3.0.7.RELEASE | Loading XML bean
> definitions from URL [bundle://324.0:0/META-INF/spring/camel-cxf.xml]
> 09:34:15,741 | ERROR | xtenderThread-36 | ContextLoaderListener
>  |
> 113 - org.springframework.osgi.extender - 1.2.1 | Application context
> refresh failed
>
> (OsgiBundleXmlApplicationContext(bundle=com.outotec.mes-bw-copper_recovery_perc_ssl,
> config=osgibundle:/META-INF/spring/*.xml))
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 39 in XML document from URL
> [bundle://324.0:0/META-INF/spring/camel-cxf.xml]
> is invalid; nested exception is org.xml.sax.SAXParseException:
> cvc-datatype-valid.1.2.3:
> '{http://es0sreao:8181/mes/bw/MEStoBW_CopperRecoveryPercentage_JAAS}.8181'
> is not a valid value of union type 'ParameterizedInt'.
>         at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)[105:org.springframework.beans:3.0.7.RELEASE]
>         at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[105:org.springframework.beans:3.0.7.RELEASE]
> *
>
> Could you please let me know what is the exact value to be entered for
> <httpj:engine port="${fromCxfEndpointUri.port}">
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5738725.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: camel-cxf and HTTP BASIC authentication

Posted by contactreji <co...@gmail.com>.
Hi Christian

I have followed your steps and made my coade as follows

*
	<cxf:cxfEndpoint id="MESEndpoint"
		address="http://server:8181/mes/bw/Service_Endpoint"
		serviceClass="company.pi.mes.id56.copperrecovery.ImplementationClass"
		wsdlURL="wsdl/myWSDL.wsdl"
		serviceName="p1:ServiceClasses" endpointName="p1:HTTPS_Port"
		xmlns:p1="urn:company:pi:mes:id56:Task" 
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />

	
	
	<httpj:engine-factory>
		<httpj:engine
			port="{http://es0sreao:8181/mes/bw/Service_Endpoint}.8181">  
			<httpj:tlsServerParameters>
				<sec:keyManagers keyPassword="fuseesb">
					<sec:keyStore type="JKS" password="fuseesb"
						file="certs/truststore.jks" />
				</sec:keyManagers>
				<sec:trustManagers>
					<sec:keyStore type="JKS" password="fuseesb"
						file="certs/truststore.jks" />
				</sec:trustManagers>
				<sec:cipherSuitesFilter>
					<sec:include>.*.*</sec:include>
					<sec:exclude>.*40_.*</sec:exclude>
					<sec:exclude>.*_RSA_WITH_DES_CBC_SHA.*</sec:exclude>
					<sec:exclude>.*_RSA_WITH_3DES_EDE_CBC_SHA.*</sec:exclude>
				</sec:cipherSuitesFilter>
				<sec:clientAuthentication want="false"
					required="false" />
			</httpj:tlsServerParameters>
			<httpj:threadingParameters minThreads="5"
				maxThreads="20" />
			<httpj:handlers>
				
				<ref bean="securityHandler" />
			</httpj:handlers>
		</httpj:engine>
	</httpj:engine-factory>

	<bean id="securityHandler"
class="org.eclipse.jetty.security.ConstraintSecurityHandler">
		<property name="authenticator">
			<bean
class="org.eclipse.jetty.security.authentication.BasicAuthenticator" />
		</property>
		<property name="constraintMappings">
			<list>
				<bean class="org.eclipse.jetty.security.ConstraintMapping">
					<property name="constraint">
						<bean class="org.eclipse.jetty.http.security.Constraint">
							<property name="name" value="BASIC" />
							<property name="roles" value="our-role-name" />
							<property name="authenticate" value="true" />
						</bean>
					</property>
					<property name="pathSpec" value="/*" />
				</bean>
			</list>
		</property>
		<property name="loginService">
			<bean class="org.eclipse.jetty.plus.jaas.JAASLoginService">
				<property name="name" value="karaf" />
				<property name="loginModuleName" value="karaf" />
				<property name="roleClassNames">
					<list>

						<value>org.apache.karaf.jaas.modules.RolePrincipal</value>
					</list>
				</property>
			</bean>
		</property>
		<property name="strict" value="false" />
		<property name="identityService">
			<bean class="org.eclipse.jetty.security.DefaultIdentityService" />
		</property>
	</bean>*


While deployment I am getting following exception in log

*
09:34:15,721 | INFO  | xtenderThread-36 | XmlBeanDefinitionReader          |
105 - org.springframework.beans - 3.0.7.RELEASE | Loading XML bean
definitions from URL [bundle://324.0:0/META-INF/spring/camel-cxf.xml]
09:34:15,741 | ERROR | xtenderThread-36 | ContextLoaderListener            |
113 - org.springframework.osgi.extender - 1.2.1 | Application context
refresh failed
(OsgiBundleXmlApplicationContext(bundle=com.outotec.mes-bw-copper_recovery_perc_ssl,
config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
39 in XML document from URL [bundle://324.0:0/META-INF/spring/camel-cxf.xml]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-datatype-valid.1.2.3:
'{http://es0sreao:8181/mes/bw/MEStoBW_CopperRecoveryPercentage_JAAS}.8181'
is not a valid value of union type 'ParameterizedInt'.
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)[105:org.springframework.beans:3.0.7.RELEASE]
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[105:org.springframework.beans:3.0.7.RELEASE]
*

Could you please let me know what is the exact value to be entered for 
<httpj:engine port="${fromCxfEndpointUri.port}"> 




--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5738725.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf and HTTP BASIC authentication

Posted by contactreji <co...@gmail.com>.
Hi Christain.. Could you please guide us with the details of dependencies
added.
Would be really helpful fi you could post the copy of your POM file.
Reji



--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5738715.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf and HTTP BASIC authentication

Posted by Christian Müller <ch...@gmail.com>.
We use the following engine factory configuration to configure our Jetty
server (placed in our bundle-context.xml Spring DM configuration)

<httpj:engine-factory bus="cxf">
    <httpj:engine port="${fromCxfEndpointUri.port}">
        <httpj:tlsServerParameters>
            <sec:keyManagers keyPassword="${keyStoreKeyPassword}">
                <sec:keyStore type="JKS" password="${keyStorePassword}"
file="${keyStoreFile}" />
            </sec:keyManagers>
            <sec:trustManagers>
                <sec:keyStore type="JKS" password="${keyStorePassword}"
file="${keyStoreFile}"/>
            </sec:trustManagers>
            <sec:cipherSuitesFilter>
                <sec:include>.*.*</sec:include>
                <sec:exclude>.*40_.*</sec:exclude>
                <sec:exclude>.*_RSA_WITH_DES_CBC_SHA.*</sec:exclude>
                <sec:exclude>.*_RSA_WITH_3DES_EDE_CBC_SHA.*</sec:exclude>
            </sec:cipherSuitesFilter>
            <sec:clientAuthentication want="false" required="false" />
        </httpj:tlsServerParameters>
        <httpj:threadingParameters minThreads="5" maxThreads="20" />
        <httpj:handlers>
            <!-- BASIC AUTHENTICATION configuration -->
            <ref bean="securityHandler"/>
        </httpj:handlers>
    </httpj:engine>
</httpj:engine-factory>


In our bundle-context-osgi Spring DM configuration which is used in Karaf,
we defined the "securityHandler" as following:
<bean id="securityHandler"
class="org.eclipse.jetty.security.ConstraintSecurityHandler">
    <property name="authenticator">
        <bean
class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
    </property>
    <property name="constraintMappings">
        <list>
            <bean class="org.eclipse.jetty.security.ConstraintMapping">
                <property name="constraint">
                    <bean
class="org.eclipse.jetty.http.security.Constraint">
                        <property name="name" value="BASIC"/>
                        <property name="roles" value="our-role-name"/>
                        <property name="authenticate" value="true"/>
                    </bean>
                </property>
                <property name="pathSpec" value="/*"/>
            </bean>
        </list>
    </property>
    <property name="loginService">
        <bean class="org.eclipse.jetty.plus.jaas.JAASLoginService">
            <property name="name" value="karaf"/>
            <property name="loginModuleName" value="karaf"/>
            <property name="roleClassNames">
                <list>

<value>org.apache.karaf.jaas.modules.RolePrincipal</value>
                </list>
            </property>
        </bean>
    </property>
    <property name="strict" value="false"/>
    <property name="identityService">
        <bean class="org.eclipse.jetty.security.DefaultIdentityService"/>
    </property>
</bean>


Edit the ${KARAF_HOME}/etc/users.properties file and add the user:
user=password,our-role-name


For our unit tests, we are using a different "securityHandler"
configuration:
<bean id="securityHandler"
class="org.eclipse.jetty.security.ConstraintSecurityHandler">
    <property name="authenticator">
        <bean
class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
    </property>
    <property name="constraintMappings">
        <list>
            <bean class="org.eclipse.jetty.security.ConstraintMapping">
                <property name="constraint">
                    <bean
class="org.eclipse.jetty.http.security.Constraint">
                        <property name="name" value="BASIC"/>
                        <property name="roles" value="our-role-name"/>
                        <property name="authenticate" value="true"/>
                    </bean>
                </property>
                <property name="pathSpec" value="/*"/>
            </bean>
        </list>
    </property>
    <property name="loginService">
        <bean class="org.eclipse.jetty.security.HashLoginService">
            <property name="name" value="karaf" />
            <property name="config"
value="src/test/resources/jetty-realm.properties" />
        </bean>
    </property>
    <property name="strict" value="false"/>
</bean>


The "jetty-realm.properties" fooks like this one:
user: password,our-role-name


We are creating our test client like this one:
String url = "https://localhost:7071/foo/services/BarService";
List<Interceptor<? extends Message>> outInterceptors =
    new ArrayList<Interceptor<? extends Message>>();

LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();
outInterceptors.add(loggingOutInterceptor);

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setBus(BusFactory.getDefaultBus());
factory.setOutInterceptors(outInterceptors);
factory.setServiceClass(SemprisEaiAIG.class);
factory.setAddress(url);
factory.setUsername("user");
factory.setPassword("password");
BarService serviceClient = (BarService) factory.create();

serviceClient.doSomething(...);

Hope this helps.

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Mon, Sep 2, 2013 at 10:02 PM, Christian Müller <
christian.mueller@gmail.com> wrote:

> Yes, we got it working. I can post the relevant code snippets here
> tomorrow.
>
> Best,
> Christian
> -----------------
>
> Software Integration Specialist
>
> Apache Camel committer: https://camel.apache.org/team
> V.P. Apache Camel: https://www.apache.org/foundation/
> Apache Member: https://www.apache.org/foundation/members.html
>
> https://www.linkedin.com/pub/christian-mueller/11/551/642
>
>
> On Tue, Aug 27, 2013 at 9:00 PM, contactreji <co...@gmail.com>wrote:
>
>> Hi Christian.. did you get a work around the problem?
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5738071.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>

Re: camel-cxf and HTTP BASIC authentication

Posted by Christian Müller <ch...@gmail.com>.
Yes, we got it working. I can post the relevant code snippets here tomorrow.

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Aug 27, 2013 at 9:00 PM, contactreji <co...@gmail.com> wrote:

> Hi Christian.. did you get a work around the problem?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5738071.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: camel-cxf and HTTP BASIC authentication

Posted by contactreji <co...@gmail.com>.
Hi Christian.. did you get a work around the problem?



--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5738071.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf and HTTP BASIC authentication

Posted by Christian Müller <ch...@gmail.com>.
Thank you all for your valuable suggestions. I will try it out and report
back.

Best,
Christian

On Wed, Jul 18, 2012 at 9:07 AM, Willem Jiang <wi...@gmail.com>wrote:

> Hi Christian,
>
> I'm afraid you have configure the interceptor yourself, or write some
> configuration to setup Jetty server as others show you.
>
> If you are using ServiceMix you can try out the Sergey shows
> JAASLoginInterceptor, and setup right context name for you to use.
>
> Here is an configuration[1] which is shows in Blueprint, but I think you
> can use it in Spring at same time.
>
> [1]https://github.com/**fusesource/fuse/blob/master/**
> examples/secure-rest/src/main/**resources/OSGI-INF/blueprint/**
> blueprint.xml<https://github.com/fusesource/fuse/blob/master/examples/secure-rest/src/main/resources/OSGI-INF/blueprint/blueprint.xml>
>
>
> On 7/18/12 5:30 AM, Christian Müller wrote:
>
>> Thanks Yogesh for taking time for my question.
>>
>> The information in [1] only helps for the client site (unit testing), but
>> I
>> have to provide this service (the server part).
>> The information in [2] and [3] are useful how to implement such kind of
>> CXF
>> interceptor, but I still hope there is an existing solution in CXF or
>> Jetty
>> which doesn't force me to implement this. May be only a simple
>> PasswordCallback or so...
>>
>> [1]
>> http://cxf.apache.org/docs/**client-http-transport-**
>> including-ssl-support.html<http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html>
>> [2]
>> http://chrisdail.com/2008/03/**31/apache-cxf-with-http-basic-**
>> authentication/<http://chrisdail.com/2008/03/31/apache-cxf-with-http-basic-authentication/>
>> [3]
>> http://chrisdail.com/2008/08/**13/http-basic-authentication-**
>> with-apache-cxf-revisited/<http://chrisdail.com/2008/08/13/http-basic-authentication-with-apache-cxf-revisited/>
>>
>> Best,
>> Christian
>>
>> On Tue, Jul 17, 2012 at 9:45 PM, ychawla <pr...@yahoo.com>**
>> wrote:
>>
>>  Hi Christian,
>>> What about adding an HTTP Conduit to your CXF bean?
>>>
>>> http://cxf.apache.org/docs/**client-http-transport-**
>>> including-ssl-support.html<http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html>
>>>
>>> Is your requirement for inbound or outbound HTTP basic auth?  Depending
>>> on
>>> your container, you might be able to do this at the Apache HTTPD or
>>> Tomcat
>>> layer as well.
>>>
>>> Thanks,
>>> Yogesh
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.**com/camel-cxf-and-HTTP-BASIC-**
>>> authentication-**tp5716163p5716169.html<http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5716169.html>
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>
> --
> Willem
> ------------------------------**----
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(English)
>          http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>
>
>

Re: camel-cxf and HTTP BASIC authentication

Posted by Willem Jiang <wi...@gmail.com>.
Hi Christian,

I'm afraid you have configure the interceptor yourself, or write some 
configuration to setup Jetty server as others show you.

If you are using ServiceMix you can try out the Sergey shows 
JAASLoginInterceptor, and setup right context name for you to use.

Here is an configuration[1] which is shows in Blueprint, but I think you 
can use it in Spring at same time.

[1]https://github.com/fusesource/fuse/blob/master/examples/secure-rest/src/main/resources/OSGI-INF/blueprint/blueprint.xml

On 7/18/12 5:30 AM, Christian Müller wrote:
> Thanks Yogesh for taking time for my question.
>
> The information in [1] only helps for the client site (unit testing), but I
> have to provide this service (the server part).
> The information in [2] and [3] are useful how to implement such kind of CXF
> interceptor, but I still hope there is an existing solution in CXF or Jetty
> which doesn't force me to implement this. May be only a simple
> PasswordCallback or so...
>
> [1]
> http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
> [2]
> http://chrisdail.com/2008/03/31/apache-cxf-with-http-basic-authentication/
> [3]
> http://chrisdail.com/2008/08/13/http-basic-authentication-with-apache-cxf-revisited/
>
> Best,
> Christian
>
> On Tue, Jul 17, 2012 at 9:45 PM, ychawla <pr...@yahoo.com>wrote:
>
>> Hi Christian,
>> What about adding an HTTP Conduit to your CXF bean?
>>
>> http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
>>
>> Is your requirement for inbound or outbound HTTP basic auth?  Depending on
>> your container, you might be able to do this at the Apache HTTPD or Tomcat
>> layer as well.
>>
>> Thanks,
>> Yogesh
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5716169.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang



Re: camel-cxf and HTTP BASIC authentication

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 17/07/12 22:30, Christian Müller wrote:
> Thanks Yogesh for taking time for my question.
>
> The information in [1] only helps for the client site (unit testing), but I
> have to provide this service (the server part).
> The information in [2] and [3] are useful how to implement such kind of CXF
> interceptor, but I still hope there is an existing solution in CXF or Jetty
> which doesn't force me to implement this. May be only a simple
> PasswordCallback or so...
>

May be JAASLoginInterceptor ?

In the simplest case you will only need to set up a JAAS context name on it:

http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java

HTH, Sergey

> [1]
> http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
> [2]
> http://chrisdail.com/2008/03/31/apache-cxf-with-http-basic-authentication/
> [3]
> http://chrisdail.com/2008/08/13/http-basic-authentication-with-apache-cxf-revisited/
>
> Best,
> Christian
>
> On Tue, Jul 17, 2012 at 9:45 PM, ychawla<pr...@yahoo.com>wrote:
>
>> Hi Christian,
>> What about adding an HTTP Conduit to your CXF bean?
>>
>> http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
>>
>> Is your requirement for inbound or outbound HTTP basic auth?  Depending on
>> your container, you might be able to do this at the Apache HTTPD or Tomcat
>> layer as well.
>>
>> Thanks,
>> Yogesh
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5716169.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>



Re: camel-cxf and HTTP BASIC authentication

Posted by Christian Müller <ch...@gmail.com>.
Thanks Yogesh for taking time for my question.

The information in [1] only helps for the client site (unit testing), but I
have to provide this service (the server part).
The information in [2] and [3] are useful how to implement such kind of CXF
interceptor, but I still hope there is an existing solution in CXF or Jetty
which doesn't force me to implement this. May be only a simple
PasswordCallback or so...

[1]
http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
[2]
http://chrisdail.com/2008/03/31/apache-cxf-with-http-basic-authentication/
[3]
http://chrisdail.com/2008/08/13/http-basic-authentication-with-apache-cxf-revisited/

Best,
Christian

On Tue, Jul 17, 2012 at 9:45 PM, ychawla <pr...@yahoo.com>wrote:

> Hi Christian,
> What about adding an HTTP Conduit to your CXF bean?
>
> http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
>
> Is your requirement for inbound or outbound HTTP basic auth?  Depending on
> your container, you might be able to do this at the Apache HTTPD or Tomcat
> layer as well.
>
> Thanks,
> Yogesh
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5716169.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: camel-cxf and HTTP BASIC authentication

Posted by ychawla <pr...@yahoo.com>.
Just re-read your message and you have a ServiceMix requirement so Tomcat and
Apache HTTPD wouldn't work.

I saw some blog entries that talks about an interceptor based approach that
might help:

http://chrisdail.com/2008/03/31/apache-cxf-with-http-basic-authentication/
http://chrisdail.com/2008/08/13/http-basic-authentication-with-apache-cxf-revisited/

Thanks,
Yogesh



--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5716173.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf and HTTP BASIC authentication

Posted by ychawla <pr...@yahoo.com>.
Hi Christian,
What about adding an HTTP Conduit to your CXF bean?

http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html

Is your requirement for inbound or outbound HTTP basic auth?  Depending on
your container, you might be able to do this at the Apache HTTPD or Tomcat
layer as well.

Thanks,
Yogesh

--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-and-HTTP-BASIC-authentication-tp5716163p5716169.html
Sent from the Camel - Users mailing list archive at Nabble.com.