Results 1 to 5 of 5

Thread: How to access HttpServletRequest in accessdecisionManager in spring security 3

  1. #1
    Join Date
    Jun 2011
    Posts
    117

    Default 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. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    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).
    Spring - by Pivotal
    twitter @tekul

  3. #3
    Join Date
    Jun 2011
    Posts
    117

    Default

    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 ?

  4. #4
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    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.
    Spring - by Pivotal
    twitter @tekul

  5. #5
    Join Date
    Jun 2011
    Posts
    117

    Default

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

    thx Luke

Posting Permissions

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