java 具有安全性的 AngularJS + Spring MVC - 从哪里开始?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29630654/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
AngularJS + Spring MVC with security - where to start?
提问by E. V. d. B.
I'm trying to build the front-end part of a project with Angular and a basic REST backend that also handles security.
我正在尝试使用 Angular 和一个也处理安全性的基本 REST 后端来构建项目的前端部分。
I have very basic knowledge of Spring but haven't really worked with Spring Security.
我对 Spring 有非常基本的了解,但还没有真正使用过 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.
我试图找到一种方法来构建一个简单的受保护的 REST 后端。我在网上搜索了很多,我发现的主要内容是本教程:https: //spring.io/guides/tutorials/spring-security-and-angular-js/。读完之后我还是不明白我应该如何开始。
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.
此外,本教程示例适用于 Spring Boot,它就像一个您必须运行的类,但我希望将更“经典”的 Spring 方法与基于 Java 的配置并在 Tomcat 上运行的 maven 结合使用,我反正不太了解 Spring Boot-way 的主类。
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?
我知道如何使用 REST 控制器设置 Spring 项目,我可以让它毫无问题地工作,所以我不需要弄清楚这一点。我确实需要弄清楚如何尽可能简单地增加安全性。我需要用户身份验证和所有这些,但我真的不知道如何去做。这需要什么?有没有更好的(非 Spring Boot)教程吗?
Any help will be much appreciated!
任何帮助都感激不尽!
回答by Abdelghani Roussi
First of all
It will be a good thing that you know what is Spring boot ( Advantage of spring boot)
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, Hymanson 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
首先
知道什么是 Spring Boot 会是一件好事(Spring Boot 的优势)
其次
以下是一些有用的资源:
2.1 这是关于架构 Web App Architecture - the Spring MVC - AngularJs stack
2.2 带有 JSON、Hymanson 和客户端程序的 Spring Restful Web 服务示例
2.3使用 Spring MVC 4.0 RESTful Web 服务和 AngularJS 的 CRUD
2.4 对于安全示例Spring Data REST + Spring Security
回答by OmarAsifShaikh
You can take a look at this open source Spring + AngularJS generator JHipster
你可以看看这个开源的 Spring + AngularJS 生成器 JHipster
Main site: http://jhipster.github.io/
主站:http: //jhipster.github.io/
quick slides: http://jhipster.github.io/presentation/#/
回答by Deepa
For BackEnd - Learn basic simple spring boot first and try with sample project..
For Frontend - Using Grunt and Yoeman, you can create angular project..
Have a look at this site..
https://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/
对于后端 - 首先学习基本的简单 spring boot 并尝试使用示例项目..
对于前端 - 使用 Grunt 和 Yoeman,您可以创建角度项目.. 看看这个站点..
https://www.sitepoint.com/kickstart -your-angularjs-development-with-yeoman-grunt-and-bower/
Configure backend port in gruntfile.js.. Now You can start working on both front end and backend independently..
在 gruntfile.js 中配置后端端口.. 现在您可以开始独立处理前端和后端..