0

We have built a custom filter that has to access a third party app - through Rest calls to get details. Process involves getting a connection through a URL and then subsequent Rest calls to get a List. Now applying the process in a custom Spring Security filter we are unable to get the list. The error :

java.net.SocketException: Software caused connection abort: recv failed

Now is this a CORS issue ? If so - how to enable CORS in Custom Spring Security Filter or is it any other issue that we are not aware about.

Note : Apologize us as we are unable to paste the Custom filter code in Stack Overflow.

  • Thanks
nocon
  • 13
  • 6
  • can you update your custom filter – kuhajeyan Dec 15 '16 at 12:46
  • Looks anetwork error. More info here http://stackoverflow.com/q/135919 You should start checking to ensure there is no network error and that your filter actually reaches that third party app. Check if you should use any proxy. – jlumietu Dec 15 '16 at 14:41
  • @jlumietu Thanks for the reply .. I dont think its a network issue, because when we do the same operation from the controller or the service class we are able to connect and get the result. But fails to do the same operation from the Custom filter. – nocon Dec 16 '16 at 03:09

1 Answers1

0

It was a CSRF issue that was blocking the rest calls.

Added <csrf disabled="true"/> and was able to make the rest call from the custom filter. However please keep in mind that disabling the csrf is counter productive while using spring security.

nocon
  • 13
  • 6