Hi,
the CXF JaasInterceptor can be used and relay to the default karaf realm:
<jaxws:endpoint address="/service">
<jaxws:inInterceptors>
<ref bean="authenticationInterceptor"/>
</jaxws:inInterceptors>
</jaxws:endpoint>
<bean id="authenticationInterceptor"
class="org.apache.cxf.interceptor.security.JAASLoginInterceptor">
<property name="contextName" value="karaf"/>
</bean>
On the other hand, Jetty can also leverages the Karaf realm with constraint:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="loginService"
class="org.eclipse.jetty.plus.jaas.JAASLoginService">
<property name="name" value="karaf" />
<property name="loginModuleName" value="karaf" />
</bean>
<bean id="constraint"
class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC"/>
<property name="roles" value="user"/>
<property name="authenticate" value="true"/>
</bean>
<bean id="constraintMapping"
class="org.eclipse.jetty.security.ConstraintMapping">
<property name="constraint" ref="constraint"/>
<property name="pathSpec" value="/*"/>
</bean>
<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>
<ref bean="constraintMapping"/>
</list>
</property>
<property name="loginService" ref="loginService" />
<property name="strict" value="false" />
</bean>
You can take a look on
http://blog.nanthrax.net/2014/08/apache-syncope-backend-with-apache-karaf/
Regards
JB
On 10/30/2014 03:27 PM, Hilderich wrote:
Hello Support Team,
In Karaf we have deployed a bundle with a Camel Route. This Camel Route is a
CXF Consumer, i.e. establishes a Web Service. This was running smoothly in
the past but now a Basic Authentication for security reasons must be done.
With no success I have done so far something as you can read in Camel forum:
http://camel.465427.n5.nabble.com/Adding-jaas-authentication-to-a-cxf-endpoint-in-karaf-td5758340.html
I just want a Basic Auth mechanism provided by Jetty and the valid accounts
should be accessed via jaas from Karaf in etc/user.properties.
Maybe you can glimpse what is misconfigured?
Kind regards,
Hilderich
--
View this message in context:
http://karaf.922171.n3.nabble.com/camel-cxf-endpoint-with-Basic-Auth-via-jaas-in-Karaf-tp4036163.html
Sent from the Karaf - User mailing list archive at Nabble.com.
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com