Spring Security unexpected behavior for REST endpoints authentication?

前端 未结 6 1577
暖寄归人
暖寄归人 2021-01-15 03:44

The scenario we are looking for is as follows:

  1. client connects with REST to a REST login url
  2. Spring microservice (using Spring Security) should return
6条回答
  •  Happy的楠姐
    2021-01-15 03:59

    You need to override the default logout success handler to avoid redirect. In spring boot2 you can do as below:

    ....logout().logoutSuccessHandler((httpServletRequest,httpServletResponse,authentication)->{
                    //do nothing not to redirect
            })
    

    For more details: Please check this.

提交回复
热议问题