Spring CorsFilter does not seem to work still receiving a 401 on preflight requests

后端 未结 1 924
感动是毒
感动是毒 2021-01-26 15:50

Hi I\'m new to spring security and trying to figure out how to configure auth server to issue tokens. the problem i have right now is that I\'m receiving 401 or 403 on the Cors

1条回答
  •  不要未来只要你来
    2021-01-26 16:11

    So I figured out what my problem I had to configure my websecurity to ignore CoresRequest request as well so inside the configure block for the websecurity i had to set this

        web.ignoring().requestMatchers(CorsUtils::isPreFlightRequest);
    

    and it started to work.

    0 讨论(0)
提交回复
热议问题