Thangadurai
Thangadurai

Reputation: 544

How to do user authentication in angularjs with Spring MVC

I am using spring MVC framework in back end as REST(JSON/XML). In front end i am using angularjs for rendering the UI.

I done with CRUD operations (Like get,add,update,delete). And i added the user authentication in angularjs with spring security (for logout used j_spring_security_logout,for login j_spring_security_check).

The Login page is .jsp file.

Actually i added the angular files inside /WEB-INF/ folder.

For session expired i will navigate to login page. Everything is working fine. But after navigate to login page if i am doing login means it's returning JSON Object instead of dashboard page.(i.e Last service or API call of session, the service call made by user).

Like below. API Call JSON Object

Please help me to do solve this stuff.

Upvotes: 0

Views: 279

Answers (1)

Aeteros
Aeteros

Reputation: 673

Please, show your security config. If you have configured login page via <security:form-login> tag, setting attribute always-use-default-target="true" will help.

Upvotes: 1

Related Questions