cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gasius <>
Subject Basic authentication works only for the first deployed application
Date Mon, 08 Oct 2012 08:04:24 GMT

I use CXF (2.4.6) over Jetty (7.4.5.v20110725) on ServiceMix 4.4.2. I need
to expose some web services secured with basic authentication. So I created
such bus configuration (only engine-factory part posted):

/    <httpj:engine-factory bus="cxf">
        <httpj:engine port="9081">
                    <beans:property name="loginService"
ref="securityLoginService" />
                    <beans:property name="constraintMappings">
                            <beans:ref bean="securityConstraintMapping" />
    <beans:bean id="securityLoginService"
        <beans:property name="name" value="WSRealm" />
        <beans:property name="config" value="etc/" />

    <beans:bean id="securityConstraint"
        <beans:property name="name" value="BASIC" />
        <beans:property name="roles" value="admin" />
        <beans:property name="authenticate" value="true" />
    <beans:bean id="securityConstraintMapping"
        <beans:property name="constraint" ref="securityConstraint" />
        <beans:property name="pathSpec" value="/*" />

And register it in OSGi service registry using name cxf-bus. Later in my
Camel routes I set bus on endpoints like this:

in first bundle:

in second bundle:

When I deploy first bundle and try to access endpoint basic authentication
credentials are requested. But when I deploy second bundle I can access
mySecondEndpoint without any authentication. If I uninstall both bundles and
switch order of deployment then basic authentication works for the second
bundle but do not for the first. What am I doing wrong? Is there some way to
refresh security handler after I do subsequent deployments?

View this message in context:
Sent from the cxf-user mailing list archive at

View raw message