Results 1 to 3 of 3

Thread: FilterSecurityInterceptor + Struts action path

  1. #1
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    5

    Default FilterSecurityInterceptor + Struts action path

    Hi,

    We are in the process of integrating Acegi in our current project that uses Struts/Spring/Hibernate. So far we've managed to replace our authorization modules with acegi's authentication package. However, we've been trying to figure out how FilterSecurityInterceptor works, specifically objectDefintionSource. We are using Struts action mapping to forward/process requests across our application. Question is how do we write this mappings to the objectDefinitionSource parameter?

    For example:

    In struts-config.xml

    <action path="/path/action"
    type="action.doSomething"
    scope="request">
    <forward name="doThis" path="/jsp/action.jsp" />
    </action>

    In our application context we try putting:

    <bean id="filterInvocationInterceptor" class="net.sf.acegisecurity.intercept.web.FilterSe curityInterceptor">
    <property name="authenticationManager"><ref bean="authenticationManager"/></property>
    <property name="accessDecisionManager"><ref local="httpRequestAccessDecisionManager"/></property>
    <property name="objectDefinitionSource">
    <value>
    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    \A/path/.*\Z=ROLE_USER
    \A/.*\Z=ROLE_USER,ROLE_ADMIN
    </value>
    </property>
    </bean>

    Now say I log in with a ROLE_ADMIN role, and click on the link with a URL that has /path/action, I am still able to see the page. Shouldn't the user be notified or not allowed to view this page? Or do I still need to place that explicitly on my JSP page?

    Any suggestions/comments will be highly appreciated :-)

  2. #2
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    5

    Default

    Ok, it was a newbie error, I didn't define the SecurityEnforcementFilter on my web.xml :roll:

    Related question is, how can I redirect a 403 status page to a user friendly page? Thanks again :-)

  3. #3
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    You'd normally use something like org.springframework.web.servlet.handler.SimpleMapp ingExceptionResolver, but it's web framework dependent.

Similar Threads

  1. Exit action from view state
    By pglezen in forum Web Flow
    Replies: 5
    Last Post: Oct 7th, 2005, 02:23 PM
  2. Replies: 4
    Last Post: Aug 1st, 2005, 03:45 PM
  3. Replies: 2
    Last Post: Jul 21st, 2005, 04:07 AM
  4. Resource: Add valid path not found
    By moacsjr in forum Data
    Replies: 3
    Last Post: May 24th, 2005, 05:53 PM
  5. Question about Action
    By snpe in forum Swing
    Replies: 3
    Last Post: Nov 8th, 2004, 08:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •