Spring Security Example
The camel-spring-security module provides authentication and authorization capabilities via Spring Security. This example shows you how to leverage the Spring Security already provides authentication mechanism and authoriationPolicy which is provided in camel-spring-security module use this functionality to implement a role based authorization application.
This example consumes messages from a servlet endpoint which is secured by Spring Security with http basic authentication, there are two serviceservices:
Code Block |
---|
"http://localhost:8080/camel/user" is for the authenticated user whose role is ROLE_USER
"http://localhost:8080/camel/admin" is for the authenticated user whose role is ROLE_ADMIN
|
You will need to compile this example first:
Code Block |
---|
cd $CAMEL_HOME/examples/camel-example-spring-security
mvn clean install
|
To run the example, you need to start up the server by typing
Code Block |
---|
mvn jetty:run
|
To stop the server hit ctrl + c
...