You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Don Doffe <fo...@gmail.com> on 2012/11/08 02:52:16 UTC

How to set HTTP Authorization Policy using Java DSL

Hi,I'm trying to set HTTP Authorization Policy as described in here
http://camel.apache.org/spring-security.html. But I need to set it using
JavaDSL:       
from("jetty://http://localhost:9090/api?matchOnUriPrefix=true")
.routeId("Activation Endpoint")        .routePolicyRef("admin_policy")But I
get following exception:org.apache.camel.NoSuchBeanException: No bean could
be found in the registry for: auth_admin_policy of type:
org.apache.camel.spi.RoutePolicyWould anyone be so kind to indicate where I
might be having a problem?Thank you.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-set-HTTP-Authorization-Policy-using-Java-DSL-tp5722325.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to set HTTP Authorization Policy using Java DSL

Posted by Willem jiang <wi...@gmail.com>.
Hi,

First you need more setup on Jetty engine to get the basic authentication done.
It could be easy if you leverage the web container which provides the function out of box.

You can find an example here[1].

The Error means camel cannot find the reference RoutePolicy from the camel context. 
You can pass the RoutePolicy instance into the route by using the this DSL
from("xxx").routePolicy(myPolicy).



[1]http://camel.apache.org/spring-security-example.html 

-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Thursday, November 8, 2012 at 9:52 AM, Don Doffe wrote:

> Hi,I'm trying to set HTTP Authorization Policy as described in here
> http://camel.apache.org/spring-security.html. But I need to set it using
> JavaDSL: 
> from("jetty://http://localhost:9090/api?matchOnUriPrefix=true")
> .routeId("Activation Endpoint") .routePolicyRef("admin_policy")But I
> get following exception:org.apache.camel.NoSuchBeanException: No bean could
> be found in the registry for: auth_admin_policy of type:
> org.apache.camel.spi.RoutePolicyWould anyone be so kind to indicate where I
> might be having a problem?Thank you.
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-set-HTTP-Authorization-Policy-using-Java-DSL-tp5722325.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).