camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Spring Security Example
Date Thu, 15 Apr 2010 08:12:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1520/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="http://cwiki.apache.org/confluence/display/CAMEL/Spring+Security+Example">Spring
Security Example</a></h2>
    <h4>Page  <b>added</b> by             <a href="http://cwiki.apache.org/confluence/display/~njiang">willem
jiang</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h2><a name="SpringSecurityExample-SpringSecurityExample"></a>Spring
Security Example</h2>

<p>This example shows you how to leverage the <a href="http://static.springsource.org/spring-security/site/index.html"
rel="nofollow">Spring Security</a> already provides authentication mechanism and
authoriationPolicy which is provided in <a href="/confluence/display/CAMEL/Spring+Security"
title="Spring Security">camel-spring-security</a> module to implement a role based
authorization application. </p>

<p>This example consumes messages from a servlet endpoint which is secured by Spring
Security with http basic authentication, there are two service:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: default; brush: java; gutter:
false"><![CDATA[
 "http://localhost:8080/camel/user" is for the authenticated user whose role is ROLE_USER
 "http://localhost:8080/camel/admim" is for the authenticated user whose role is ROLE_ADMIN
]]></script>
</div></div>

<p>You will need to compile this example first:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: default; brush: java; gutter:
false"><![CDATA[
  cd $CAMEL_HOME/examples/camel-example-spring-security
  mvn clean install
]]></script>
</div></div>

<p>To run the example, you need to start up the server by typing</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: default; brush: java; gutter:
false"><![CDATA[
  mvn jetty:run
]]></script>
</div></div>
<p>To stop the server hit ctrl + c</p>

<p>Then you can use the script in the client directory to send the request and check
the response.</p>

<p>Here is the camel route configuration</p>
<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException:
Index: 20, Size: 20</span> </div>

<p>You can find how to configure the camel-servlet with http basic authentication by
check the files in <a href="https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-spring-security/src/main/webapp/WEB-INF"
rel="nofollow">WEB-INF</a> </p>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="http://cwiki.apache.org/confluence/display/CAMEL/Spring+Security+Example">View
Online</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/CAMEL/Spring+Security+Example?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message