Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS + Spring MVC with security - where to start?

I'm trying to build the front-end part of a project with Angular and a basic REST backend that also handles security.

I have very basic knowledge of Spring but haven't really worked with Spring Security.

I'm trying to find a way to build a simple REST backend that is secured. I have searched online a lot and the main thing i found was this tutorial: https://spring.io/guides/tutorials/spring-security-and-angular-js/ . After reading it I still don't understand how I should get started.

Also, this tutorial example works with Spring Boot and it has like a class you have to run and such, but I would like the more 'classic' Spring approach combined with maven where it's java-based configs and it runs on a Tomcat, I don't really understand the main class of the Spring Boot-way anyways.

I know how to set up a Spring project with REST controllers and I can get this to work without a problem, so that's something I don't need to figure out. I do need to figure out how to add security as simple as possible. I need user authentication and all that, but I really really have not a single clue how to go about is. What is all needed for this? Are there any better (non Spring Boot) tutorials out there?

Any help will be much appreciated!

like image 904
E. V. d. B. Avatar asked Apr 14 '15 14:04

E. V. d. B.


People also ask

Can we use Spring Security in Spring MVC?

To enable Spring Security integration with Spring MVC add the @EnableWebSecurity annotation to your configuration. Spring Security provides the configuration using Spring MVC's WebMvcConfigurer.

How do I start Spring Security?

For adding a Spring Boot Security to your Spring Boot application, we need to add the Spring Boot Starter Security dependency in our build configuration file. Maven users can add the following dependency in the pom. xml file. Gradle users can add the following dependency in the build.

Can we use Spring Security with Angular?

Conclusion. We've learned how to implement a Spring Security login page with Angular. From version 4 onwards, we can make use of the Angular CLI project for easy development and testing.


1 Answers

  1. First of all

    It will be a good thing that you know what is Spring boot ( Advantage of spring boot )

  2. secondly

    Here is some helpful resources :

    2.1 This is about the architecture Web App Architecture - the Spring MVC - AngularJs stack

    2.2 Spring Restful Web Service Example with JSON, Jackson and Client Program

    2.3 CRUD using Spring MVC 4.0 RESTful Web Services and AngularJS

    2.4 And for the security example Spring Data REST + Spring Security

like image 50
Abdelghani Roussi Avatar answered Oct 19 '22 23:10

Abdelghani Roussi