Jul 25th, 2011, 01:54 AM
How to access HttpServletRequest in accessdecisionManager in spring security 3
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
Jul 25th, 2011, 07:42 AM
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).
Jul 26th, 2011, 12:05 AM
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 ?
Jul 26th, 2011, 01:35 PM
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.
Jul 27th, 2011, 09:01 AM
Ok i think its not working the way i want to i will find some other alternative