Results 1 to 2 of 2

Thread: Support for more than one access denied handler.

  1. #1
    Join Date
    Nov 2011
    Posts
    2

    Default Support for more than one access denied handler.

    Is there a strategy or implementation in spring security to support more than one access denied handler? I did not see a way to do so with anything existing but thought I would ping the forum for ideas.

    For our application we have both ajax and traditional web MVC patterns. For the ajax handling we are expecting a JSON response which has client side exception handling and for HTTP GET open window flows a custom access denied view will be rendered.

    Currently we are thinking to create and register a custom AccessDeniedHandler which uses a factory pattern based on URL matching patterns to delegate to the correct handler. It would be great if I could just declare this on the interceptor-url definitions.

  2. #2
    Join Date
    Dec 2008
    Location
    New York City
    Posts
    134

    Default

    Quote Originally Posted by btravis View Post
    Is there a strategy or implementation in spring security to support more than one access denied handler? I did not see a way to do so with anything existing but thought I would ping the forum for ideas.

    For our application we have both ajax and traditional web MVC patterns. For the ajax handling we are expecting a JSON response which has client side exception handling and for HTTP GET open window flows a custom access denied view will be rendered.

    Currently we are thinking to create and register a custom AccessDeniedHandler which uses a factory pattern based on URL matching patterns to delegate to the correct handler. It would be great if I could just declare this on the interceptor-url definitions.
    Typically with AJAX, you need to write some client side code if you want to do a redirect. Have you considered writing that code to be triggered by the http response code?
    Andrew Thompson - Linked In

Posting Permissions

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