My web application has a bunch of "normal" resources (html pages, etc.), as well as some REST resources that are called from JavaScript on the previously mentioned html pages.
If there is a session timeout, the user is redirected to the login form. This is great for "normal" resources, but not for REST resources. I just need a 403 answer so that JavaScript can take over and ask the user to re-authenticate.
There are many examples on the Internet for customizing each of them, but I cannot find an example of how to combine the methods. All my API URLs start with "/ api /", so I will need 403 for all of these URLs and a redirect for all other URLs. How to set it up?
spring security
yankee
source share