A project template as an example of integration amoung Spring framework MVC, Rest, Security and Data modules and AngularJS. Inspired in philipsorst/angular-rest-springsecurity project.
Aspects presented in project:
- A relational or NoSQL database to manage users with Spring data MongoDB or JPA;
- A REST service to expose users data;
- Authentication and authorization against the REST service.
- A set of AngularJS application pages to view or edit users depending on their role.
- Application setup with servlet 3.0 specification and without XML configs;
- Logback set to debug operations;
- Users data exposes through REST;
- Exposing HTML, CSS, Javascript and other non-secured resources, however each one can be blocked through a Spring Security rule;
- Errors and exceptions controlled via advices;
- Rules in order to filter requests to rest application and html pages;
- Custom authentication entry-point and request filter based on token;
- Token utils;
-
Angular Routes;
-
$rootScope and cookies are used to hold and save credentials;
-
routeChange listener checking credentials;
-
HTTP interceptor to catch errors form back-end;
-
User operation methods in $rootScope:
ng-show = "hasRole('ROLE_ADMINISTRATOR')" #enable or disable content based on roles ng-click = "logout()" #erase any authetication record
Spring projects:
- Spring (MVC) - 4.0.0.RELEASE
- Spring Data JPA - 1.4.3.RELEASE
- Spring Data MongoDB - 1.3.3.RELEASE
- Spring Security - 3.2.0.RELEASE
Other projects:
JS libs:
- It's only an example/demonstration and does not aim to be used for production projects. Use it to learn about the technologies used.
- Despite there are many different technogies involved, this project focus on Spring Security and Angular integration;