So, i've figured it out by myself. Here is the solution for those who might
have the same issue.

It seems Camel security 2.17.3 depends on Spring security 4.x...but the
camel-context spring security part of the example is written in Spring
security 3.x, which produces the errors above, because, indeed, in Spring
security 4.x, there is no more default constructor for AffirmativeBased
(which existed in 3.x version).

So below are the changes to do in camel-context.xml.

The <spring-security:http> becomes:
<spring-security:http realm="User Restrict Realm">
    *<spring-security:intercept-url pattern="/camel/**"
access="hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')"/>*
    <spring-security:http-basic/>
    <spring-security:remember-me/>
  </spring-security:http>

And the accessDecisionManager becomes:
<bean id="accessDecisionManager"
class="org.springframework.security.access.vote.AffirmativeBased">
    <property name="allowIfAllAbstainDecisions" value="true"/>
    *<constructor-arg>
      <list>
        <bean class="org.springframework.security.access.vote.RoleVoter"/>
      </list>
    </constructor-arg>*
  </bean>

Then you can mvn install and mvn jetty:run without any error, and test the
endpoints by passing the credentials in HTTP Authorization header.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Can-t-make-camel-example-spring-security-works-tp5786528p5786624.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to