401 instead of 403 with Spring Boot 2

前端 未结 4 907
情歌与酒
情歌与酒 2020-12-09 17:49

With Spring Boot 1.5.6.RELEASE I was able to send HTTP Status code 401 instead of 403 as described in How let spring security response una

4条回答
  •  爱一瞬间的悲伤
    2020-12-09 18:27

    Http401AuthenticationEntryPoint was removed.

    See Spring Boot Github Repo > Issue #10715 (Remove Http401AuthenticationEntryPoint):

    Remove Http401AuthenticationEntryPoint

    rwinch commented on 20 Oct 2017
    As far as I can tell it is not being used in the Spring Boot code base, so it might be good to remove Http401AuthenticationEntryPoint.

    Depending on your requirements, you could use:

    • HttpStatusEntryPoint
    • BasicAuthenticationEntryPoint

提交回复
热议问题