You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/05/01 04:57:00 UTC

[jira] [Commented] (CAMEL-14990) camel-jetty consumers w/ different security handlers on different paths and same port don't work

    [ https://issues.apache.org/jira/browse/CAMEL-14990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17097166#comment-17097166 ] 

Claus Ibsen commented on CAMEL-14990:
-------------------------------------

They are on the same port, you cannot AFAIK have different authentication per context-path. So change one of them to use another port number.

> camel-jetty consumers w/ different security handlers on different paths and same port don't work
> ------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-14990
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14990
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jetty
>    Affects Versions: 3.0.1
>            Reporter: Gerald Kallas
>            Priority: Minor
>
> I've created two Blueprint DSLs. The 1st one works as expected w/ basic auth.
> {code:xml}
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
> 		   xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
> 		   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 		   xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
> 		   xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
> 	<!-- set security constraints -->
> 	<bean id="constraint_TSTISP001" class="org.eclipse.jetty.util.security.Constraint">
> 		<property name="name" value="BASIC"/>
> 		<property name="authenticate" value="true"/>
> 		<property name="roles">
> 			<list>
> 				<value>TSTISP001</value>
> 			</list>
> 		</property>
> 	</bean>
> 	<bean id="constraintMapping_TSTISP001" class="org.eclipse.jetty.security.ConstraintMapping">
> 		<property name="constraint" ref="constraint_TSTISP001"/>
> 		<property name="pathSpec" value="/hello1"/>
> 	</bean>
> 	<bean id="securityHandler_TSTISP001" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
> 		<property name="loginService">
> 			<bean class="org.eclipse.jetty.security.HashLoginService">
> 				<property name="config" value="/opt/apache-karaf/etc/TSTISP001.properties"/>
> 			</bean>
> 		</property>
> 		<property name="authenticator">
> 			<bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
> 		</property>
> 		<property name="constraintMappings">
> 			<list>
> 				<ref component-id="constraintMapping_TSTISP001"/>
> 			</list>
> 		</property>
> 	</bean>
> 	<camelContext xmlns="http://camel.apache.org/schema/blueprint" streamCache="true" useBreadcrumb="true">
> 		<route id="isp.route.user.TSTISP001">
> 			<from uri="jetty:http://0.0.0.0:8182/hello1?handlers=securityHandler_TSTISP001" />
> ...
> {code}
> The property file TSTISP001.properties looks like
> {code:xml}
> username1=password1,TSTISP001
> {code}
> After deploying a 2nd Blueprint DSL like
> {code:xml}
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
> 		   xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
> 		   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 		   xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
> 		   xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
> 	<!-- set security constraints -->
> 	<bean id="constraint_TSTISP002" class="org.eclipse.jetty.util.security.Constraint">
> 		<property name="name" value="BASIC"/>
> 		<property name="authenticate" value="true"/>
> 		<property name="roles">
> 			<list>
> 				<value>TSTISP002</value>
> 			</list>
> 		</property>
> 	</bean>
> 	<bean id="constraintMapping_TSTISP002" class="org.eclipse.jetty.security.ConstraintMapping">
> 		<property name="constraint" ref="constraint_TSTISP002"/>
> 		<property name="pathSpec" value="/hello2"/>
> 	</bean>
> 	<bean id="securityHandler_TSTISP002" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
> 		<property name="loginService">
> 			<bean class="org.eclipse.jetty.security.HashLoginService">
> 				<property name="config" value="/opt/apache-karaf/etc/TSTISP002.properties"/>
> 			</bean>
> 		</property>
> 		<property name="authenticator">
> 			<bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
> 		</property>
> 		<property name="constraintMappings">
> 			<list>
> 				<ref component-id="constraintMapping_TSTISP002"/>
> 			</list>
> 		</property>
> 	</bean>
> 	
> 	<camelContext xmlns="http://camel.apache.org/schema/blueprint" streamCache="true" useBreadcrumb="true">
> 		<route>
> 			<from uri="jetty:http://0.0.0.0:8182/hello2?handlers=securityHandler_TSTISP002" />
> ...
> {code}
> with the corresponding TSTISP002.properties file
> {code:xml}
> username2=password2,TSTISP002
> {code}
> the 2nd route works as expected.
> The 1st route doesn't have any authentication anymore after the deployment of the 1st route.
> A platform restart doesn't help. The 2nd route started of both has authentication, the 1st one is loosing the authentication.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)