Deadbolt action with BodyParser parses body first and then authenticates

121 views Asked by At

I'd like to use the tolerantJson body parser within a Deadbolt action like this:

actionBuilders.PatternAction(value = permission.value,
  patternType = PatternType.EQUALITY).apply(parse.tolerantJson)

But that parses the body of the request first before performing the authentication checks... so if I have an unauthenticated user POST-ing a request with malformed json string as a body the response will be 400 instead of 401.

Any idea how to tie these two together so the authentication comes before the parsing of the request body?

deadbolt - 2.5.0, scala play - 2.5

0

There are 0 answers