Summary
We have an application with spring security 3.x and Jersy 1.x for REST services. As part of application security, i wanted to authenticate one of the end point for file upload. I was trying to send title value as argument to hasPermission method, but i am getting 400 bad request and nothing is being logged. Below is the code snippet.
I have also raised the issue in StackOverflow: http://stackoverflow.com/questions/38179555/unable-to-access-jersy-formdata-params-using-spring-el. As it's an urgent i am posting the same question here. Below is the code snippet
import com.sun.jersey.multipart.FormDataParam;
@Path("/<apiName>")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Transactional
@PreAuthorize("hasRole('test') and @accessAuthority.hasPermission (principal.id,#title)")
public ResponseVO generateTitle(@FormDataParam("title") String title) throws ApplException
Actual Behavior
Getting Status code 400 - bad Request while performing this action
Expected Behavior
I was thinking FormDataParam might also be accepted similar to accepting String inputs
Configuration
Version
spring.security.version :3.1.3.RELEASE jersey.version:1.10
Sample
Comment From: rwinch
Are you using MultipartFilter before Spring Security's filters? This is necessary if you want to access parameters on a multipart request.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.