Spring Security Disable Login Page / Redirect

前端 未结 5 2522
旧巷少年郎
旧巷少年郎 2021-02-18 13:58

Is there a way to disable the redirect for Spring Security and the login page. My requirements specify the login should be part of the navigation menu.

Example:

5条回答
  •  余生分开走
    2021-02-18 14:43

    When a browser gets a 401 with "WWW-Authetication: Basic ... ", it pops up a Dialog. Spring Security sends that header unless it sees "X-Requested-With" in the request.

    You should send "X-Requested-With: XMLHttpRequest" header for all requests, this is an old fashioned way of saying - I am an AJAX request.

提交回复
热议问题