Spring Security
  1. Spring Security
  2. SEC-1100

Add "access-denied-handler-ref" to <security:http> so AccessDeniedHandler can be configurable

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 3.0.0 M1
    • Component/s: Namespace
    • Labels:
      None

      Description

      Currently <security:http> does not allow replacing the AccessDeniedHandler in exceptionTranslationFilter, need to add an attribute reference to the desired AccessDeniedHandler.

        Activity

        Hide
        Ryan Holliday added a comment -

        This functionality would also be helpful with the JAMWiki project's Spring Security implementation. Currently the project uses a single user database but has the concept of "virtual" instances such as "/context/instance1/" and "/context/instance2" to simplify management. The different "instances" are primarily used for determining what language to display a page in, but there is additional functionality that makes having separate instances important. With current Spring Security namespace configuation we could specify an "access-denied-page" reference on the http attribute, but that would force all access denied errors to a single page, and we actually need to make sure that users are sent to the appropriate sub-page for whatever "instance" they are on.

        Show
        Ryan Holliday added a comment - This functionality would also be helpful with the JAMWiki project's Spring Security implementation. Currently the project uses a single user database but has the concept of "virtual" instances such as "/context/instance1/" and "/context/instance2" to simplify management. The different "instances" are primarily used for determining what language to display a page in, but there is additional functionality that makes having separate instances important. With current Spring Security namespace configuation we could specify an "access-denied-page" reference on the http attribute, but that would force all access denied errors to a single page, and we actually need to make sure that users are sent to the appropriate sub-page for whatever "instance" they are on.
        Hide
        Luke Taylor added a comment -

        I've added support for an <access-denied-handler> element, which should be used in preference to the original access-denied-page attribute.

        It can take either a reference or an "error-page" attribute:

        <http>
        <access-denied-handler ref="myAccessDeniedHandler"/>
        ...
        </http>

        or

        <http>
        <access-denied-handler error-page="/access-denied.html"/>
        ...
        </http>

        Show
        Luke Taylor added a comment - I've added support for an <access-denied-handler> element, which should be used in preference to the original access-denied-page attribute. It can take either a reference or an "error-page" attribute: <http> <access-denied-handler ref="myAccessDeniedHandler"/> ... </http> or <http> <access-denied-handler error-page="/access-denied.html"/> ... </http>

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Daniel Woo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: