Skip to content

Commit

Permalink
#4 #5 #6
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadR committed May 4, 2014
1 parent 21b416e commit 63b8668
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,17 @@ coffee_req
==========

appengine app to order coffee - ShipIt !


IF you want to secure static resources, such as HTML files, the way to do this using Spring MVC is to put them in directory A, and to
map this location to path B. Then, using Spring Security, path B can be "secured".
If resources are in path A and SS secures the same path, then when a user tries to reach a resource from the browser, it "confises" spring
so the resource is not secured and the resource can be seen.

<mvc:resources mapping="/secured/**" location="/secured_resources/" />

<sec:http authentication-manager-ref="authenticationManager">
<sec:intercept-url pattern="/secured/**" access="ROLE_USER" />


If you want to secure JSP - this is wasy since it is not "static" resource.
4 changes: 4 additions & 0 deletions coffee-req/src/main/webapp/WEB-INF/spring-servlet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
<sec:debug />
-->

<!-- if I want to secure HTMLs, I put them in 'secured_resources', and map it to
'secured', where 'secured' is secured (in http) - ->
<mvc:resources mapping="/secured/**" location="/secured_resources/" />
-->


<sec:http pattern="/login/**" security="none" />
Expand All @@ -38,6 +41,7 @@

<sec:http authentication-manager-ref="authenticationManager">
<sec:intercept-url pattern="/secured/**" access="ROLE_USER" />

<sec:anonymous />

<sec:form-login login-page="/login/login.htm"
Expand Down

0 comments on commit 63b8668

Please sign in to comment.