Authentication and authorization using Spring Security
This recipe will show how using the Spring Security framework you can authenticate credentials passed into a route on an exchange, and determine whether that user/system (Principal in security terms) is authorized to access the route based on their role.
Getting ready
The Java code for this recipe is located in the org.camelcookbook.security.springsecurity
package. The Spring XML files are located under src/main/resources/META-INF/spring
and prefixed with springSecurity
.
To use Camel's Spring Security Component, add the following to the dependencies
section of your Maven POM:
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-security</artifactId> <version>${camel-version}</version> </dependency>
In order for your configuration to be parsed correctly, you will also need the appropriate Spring Security JARs without any of their Core Spring dependencies in order...