You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by blacar <bc...@gmail.com> on 2014/02/27 22:15:16 UTC
Can i plug javax.servlet.Filter with CXF (authentication)?
Hi guys,
Is it possible to plug javax.servlet.Filter somehow with CXF?
I am tryng to understand digest authentication.
Seen that spring security DigestAuthenticationFilter is very clean written
my ideas was to plug it to CXF (it's already a filter!! :P)
So i tried:
<jaxrs:server id="customerService" address="http://localhost:9095/rest">
<jaxrs:serviceBeans>
<bean class="com.blacar.apps.spike.jaxrs.CustomerService" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref bean="digestFilter" />
</jaxrs:providers>
</jaxrs:server>
<bean id="digestFilter"
class="org.springframework.security.web.authentication.www.DigestAuthenticationFilter">
<property name="userDetailsService" ref="inMemoryUserDetailsService" />
<property name="authenticationEntryPoint" ref="digestEntryPoint" />
</bean>
...
and, of course it didn't works since this is a javax.servlet.Filter with
doFilter method
instead of a request/response hander JAX-RS Filter.
Might be possible this approach? ... to plug javax.servlet.Filter in some
way
in the interception/filtering chain of the CXF stack?
Thanks in advance!!
RBC
--
View this message in context: http://cxf.547215.n5.nabble.com/Can-i-plug-javax-servlet-Filter-with-CXF-authentication-tp5740614.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Can i plug javax.servlet.Filter with CXF (authentication)?
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi, I believe so, I recall users were discussing such issues before,
please check the archives
Sergey
On 28/02/14 07:58, blacar wrote:
> Hi Sergey,
>
> Thanks for your suggestion.
>
> I am using embedded jetty server (cxf-rt-transports-http-jetty) and i have
> no reason to use web.xml file ... unless there is no other way to plug that
> filter.
>
> That is why i prefer to avoid the usual spring-security configuration which
> which (as far as i know) will force me to have that web.xml i don't want to
> have. Also i am going to use digest authentication only, no authorization or
> other features.
>
> Is there other way to plug a servlet filter with CXF?
>
> Thanks again,
>
> RBC.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Can-i-plug-javax-servlet-Filter-with-CXF-authentication-tp5740614p5740627.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
Re: Can i plug javax.servlet.Filter with CXF (authentication)?
Posted by blacar <bc...@gmail.com>.
Hi Sergey,
Thanks for your suggestion.
I am using embedded jetty server (cxf-rt-transports-http-jetty) and i have
no reason to use web.xml file ... unless there is no other way to plug that
filter.
That is why i prefer to avoid the usual spring-security configuration which
which (as far as i know) will force me to have that web.xml i don't want to
have. Also i am going to use digest authentication only, no authorization or
other features.
Is there other way to plug a servlet filter with CXF?
Thanks again,
RBC.
--
View this message in context: http://cxf.547215.n5.nabble.com/Can-i-plug-javax-servlet-Filter-with-CXF-authentication-tp5740614p5740627.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Can i plug javax.servlet.Filter with CXF (authentication)?
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
Configure Spring Security independently as per its configuration rules,
and it will work OK
Sergey
On 27/02/14 21:15, blacar wrote:
> Hi guys,
>
> Is it possible to plug javax.servlet.Filter somehow with CXF?
>
> I am tryng to understand digest authentication.
>
> Seen that spring security DigestAuthenticationFilter is very clean written
> my ideas was to plug it to CXF (it's already a filter!! :P)
>
> So i tried:
>
> <jaxrs:server id="customerService" address="http://localhost:9095/rest">
> <jaxrs:serviceBeans>
> <bean class="com.blacar.apps.spike.jaxrs.CustomerService" />
> </jaxrs:serviceBeans>
> <jaxrs:providers>
> <ref bean="digestFilter" />
> </jaxrs:providers>
> </jaxrs:server>
>
> <bean id="digestFilter"
>
> class="org.springframework.security.web.authentication.www.DigestAuthenticationFilter">
> <property name="userDetailsService" ref="inMemoryUserDetailsService" />
> <property name="authenticationEntryPoint" ref="digestEntryPoint" />
> </bean>
>
> ...
>
> and, of course it didn't works since this is a javax.servlet.Filter with
> doFilter method
> instead of a request/response hander JAX-RS Filter.
>
> Might be possible this approach? ... to plug javax.servlet.Filter in some
> way
> in the interception/filtering chain of the CXF stack?
>
> Thanks in advance!!
>
> RBC
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Can-i-plug-javax-servlet-Filter-with-CXF-authentication-tp5740614.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com