Hello

I've just fixed https://github.com/ops4j/org.ops4j.pax.web/issues/1717
(where WAB and HttpService servlet conflicted within single "/" context)
and this _may_ be the same issue.
I'm on PTO today, but let me check this on Monday.

I've created https://github.com/ops4j/org.ops4j.pax.web/issues/1720 to
track this.

regards
Grzegorz Grzybek

pt., 20 maj 2022 o 09:45 Gerald Kallas - mailbox.org <[email protected]>
napisał(a):

> Hi Grzegorz,
>
> seems to me rather a pay-jetty issue than a karaf one. May be I miss
> something in the configuration for concurrent security claims?
>
> If you‘d have some advice it would really be helpful 😊
>
> Sent by my mobile device
> - Gerald Kallas
>
> Anfang der weitergeleiteten Nachricht:
>
> *Von:* Gerald Kallas <[email protected]>
> *Datum:* 20. Mai 2022 um 00:59:36 MESZ
> *An:* [email protected]
> *Betreff:* *pax-web-jetty configuration issue*
>
> 
> Hi folks.
>
> I do have a vanilla Karaf 4.4.0 installation with Camel 3.14.3 with the
> modules
>
> pax-web-jetty
> hawtio
> activemq-broker-noweb
> camel
> camel-jms
> jms
> camel-http
> camel-servlet
> camel-swagger-java
> camel-ftp
> camel-jackson
> camel-jsonpath
> camel-json-validator
> camel-zipfile
> camel-velocity
> camel-groovy
> camel-salesforce
> camel-kafka
>
>
> Further I do have a Blueprint route sample1.xml like
>
> <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";
> xsi:schemaLocation="
> http://www.osgi.org/xmlns/blueprint/v1.0.0
> https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";>
> <reference id="httpService" interface="org.osgi.service.http.HttpService"
> />
> <bean id="camelServlet1"
> class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/>
> <bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer"
> init-method="register"
> destroy-method="unregister">
> <property name="servletName" value="servlet1" />
> <property name="alias" value="/test1" />
> <property name="httpService" ref="httpService" />
> <property name="servlet" ref="camelServlet1" />
> </bean>
> <camelContext id="sample1" xmlns="http://camel.apache.org/schema/blueprint
> ">
> <route>
> <from uri="servlet://hello?servletName=servlet1" />
> <log message="Hello Camel 1!" />
> </route>
> </camelContext>
> </blueprint>
>
> and a security configuration org.ops4j.pax.web.context-admin.sample1.cfg
> like
>
> bundle.symbolicName=sample1.xml
> login.config.authMethod=BASIC
> login.config.realmName=karaf
> context.id=default
> security.constraint.1.url = /test1/hello/*
> security.constraint.1.roles = testrole
>
> Authentication/authorization works fine with
>
> curl --insecure --request GET 'https://localhost:8443/test1/hello' -u
> testuser:passw0rd
>
> returns HTTP 200
>
> curl --insecure --request GET 'https://localhost:8443/test1/hello'
>
> returns HTTP 401
>
>
> When I'm going to add a 2nd Blueprint route sample2.xml like
>
> <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";
> xsi:schemaLocation="
> http://www.osgi.org/xmlns/blueprint/v1.0.0
> https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";>
> <reference id="httpService" interface="org.osgi.service.http.HttpService"
> />
> <bean id="camelServlet2"
> class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/>
> <bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer"
> init-method="register"
> destroy-method="unregister">
> <property name="servletName" value="servlet2" />
> <property name="alias" value="/test2" />
> <property name="httpService" ref="httpService" />
> <property name="servlet" ref="camelServlet2" />
> </bean>
> <camelContext id="sample2" xmlns="http://camel.apache.org/schema/blueprint
> ">
> <route>
> <from uri="servlet://hello?servletName=servlet2" />
> <log message="Hello Camel 2!" />
> </route>
> </camelContext>
> </blueprint>
>
> with the security configuration
> org.ops4j.pax.web.context-admin.sample2.cfg like
>
> bundle.symbolicName=sample2.xml
> login.config.authMethod=BASIC
> login.config.realmName=karaf
> context.id=default
> security.constraint.1.url = /test2/hello/*
> security.constraint.1.roles = testrole
>
> the authentication/authorization for the 2nd route doesn't work as
> expected. The endpoint
>
> curl --insecure --request GET 'https://localhost:8443/test2/hello'
>
> returns a HTTP 200 (I'm expecting a HTTP 401 w/o user:password).
>
>
> When I'm going to remove sample1.xml, the call to the sample2.xml endpoint
>
> curl --insecure --request GET 'https://localhost:8443/test2/hello' -u
> testuser:passw0rd
>
> returns a HTTP 404. When I'm going to re-deploy the sample2.xml, the
> sample2.xml endpoint works fine, even with authentication/authorization.
>
> Any ideas about this behaviour are highly appreciated.
>
> Best
> Gerald
>
>

Reply via email to