Hello,

I am trying to solve a problem with using multiple securityHandlers across
multiple Proxies (XML files) running on the same port in karaf.

Let's say proxies are configures like this, differs only in the id of the
securityHandler and the role. Everything else is same for every XML file.

All proxies operate on the same port (i.e. 0.0.0.0:9091).

Jetty is used (v9.2), but older version suffers also with issue. 
Camel v.2.16.3

What happens here is karaf creates proxy services from XML blueprints,
creates camel contexts for each proxy and creates routes. So far so good.
Problem happens when I try to request one of the routes with authentication
applied. At that time only one securityHandler is randomly loaded by jetty
and the others (with others IDs) are overwritten.

<blueprint>
.....
        <bean id="loginService" class="org.eclipse.jetty.jaas.JAASLoginService">
                <property name="name" value="karaf" />
                <property name="loginModuleName" value="karaf" />
                <property name="roleClassNames">
            <list>
               
<value>org.apache.karaf.jaas.boot.principal.RolePrincipal</value>
            </list>
        </property>
        </bean>

        <bean id="identityService"
class="org.eclipse.jetty.security.DefaultIdentityService" />

        <bean id="constraint" 
class="org.eclipse.jetty.util.security.Constraint">
                <property name="name" value="BASIC" />
                <property name="roles">
                        <array value-type="java.lang.String">
                                <value>RIGHT_proxy1</value>
                        </array>
                </property>
                <property name="authenticate" value="true" />
        </bean>

        <bean id="securityHandler2"
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" 
ref="constraint" />
                                        <property name="pathSpec" 
value="/proxy1/*" />
                                </bean>
                        </list>
                </property>
                <property name="loginService" ref="loginService" />
                <property name="identityService" ref="identityService" />
        </bean>
...
</blueprint>

Any ideas how to solve the issue?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Jetty-overrides-multiple-securityHandles-tp5783828.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to