Spring Security keeps redirecting me to login page

前端 未结 2 1089
清歌不尽
清歌不尽 2020-12-31 16:42

What ever link I type in the address bar it keeps redirecting me to the login page. How can I prevent that?

For example if i add http://localhost:8080/asdasdsa > i

2条回答
  •  甜味超标
    2020-12-31 17:31

    Try with 127.0.0.1 instead of localhost.

    Explanation

    Your browser doesn't set the JSESSIONID cookie for localhost (see this SO question), so when redirecting after successful login the next request looks not authenticated to the server.

    If you use idea and you open the browser clicking on the Services panel, you can add this config in your application-dev.yml to fix that:

    server:
      address: 127.0.0.1
    

提交回复
热议问题