I write a simple application with java and spring mvc framework .
I use tomcat realm authentication FORM auth-method for auth users and redirect him to own dashboard .
for example user on login.jsp enter username and password , now in controller check name and pass and use request.login(username,password) method and then send redirect client to dashboard page .
now i create a restful api for detect some information from server . for example this url :
"http://IP-ADDRESS:8080/admin/getAllPersons.do"
must response all persons in server .
my problem is :
when i use chrome postman plugin and set authentication on BASIC and send request to server , receive html content of login.jsp .
because :
"/admin/*" restricted by security-constraint with FORM authentication method and i set "form-error-page" on login.jsp .
I think we did change auth-method to BASIC for use restful web service . but if i do that actually login.jsp not more need .
I need use login.jsp and need use BASIC auth method !!!
really can do that ?
Or maybe can authenticate with FORM auth method in restful web service ?
I mean can config apache tomcat for use multiple login-config for different path's ?
What is your proposal ?