Announcement Announcement Module
Collapse
No announcement yet.
How to access HttpServletRequest in accessdecisionManager in spring security 3 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to access HttpServletRequest in accessdecisionManager in spring security 3

    Hi Guys,
    I had to write my own accessdecisionmanager and i have overriden decide method of it.
    I want to have access to HttpServletRequest.

    Can somebody help me how to get HttpServletobject ?

    I require that object because my authorization is based on some request parameterds


    Thanks and Regards
    Patil Abhijeet

  • #2
    If you are using it in the FilterSecurityInterceptor, then you can cast the second argument in the decide method to a FilterInvocation (which has a reference to the request object).

    Comment


    • #3
      I have written my class which implements AccessDecisionManager. I am not using any FilterSecurityInterceptor.

      But I can change my implmentation if required what do you suggest ?

      Comment


      • #4
        Try what I suggested above (casting the object to a FilterInvocation instance).

        If that fails, explain how you are actually using the AccessDecisionManager. If you are using it for method security (i.e. not in the web layer) then you won't have access to the request object.

        Comment


        • #5
          Ok i think its not working the way i want to i will find some other alternative

          thx Luke

          Comment

          Working...
          X