确保Spring Boot REST API的安全性

huangapple go评论72阅读模式
英文:

Securing a spring boot REST api

问题

我是Spring Boot API的初学者。目前,我正在观看视频并练习编程。

我正在使用IntelliJ本地开发应用程序,最终目标是部署到Google Cloud或AWS。

如果我想使用OAuth2来保护API,那么是否需要考虑额外的费用,比如授权服务器?在我开始实现REST API之前,大致需要考虑哪些方面,比如费用、服务器、部署平台等?是否有一些示例可以指导初学者?

英文:

I am a beginner in spring boot api . Currently I am through the videos and practicing the programming.
I am developing the application locally using intellij and ultimately aim to deploy to either Google cloud or AWS.

If I want to secure the api using oauth2 then is there any additional cost I need to consider like for eg., authorization server . What all I need to consider like cost, server, platform to deploy etc roughly before I start implementing REST api?any examples to guide for a beginner?

答案1

得分: 2

为了保护您的REST API,我们需要执行以下操作:

1- 配置Spring安全性和数据库。

2- 配置授权服务器和资源服务器。(需要创建一个授权服务器)

3- 获取访问令牌和刷新令牌。

4- 使用访问令牌获取受保护的资源(REST API)。

英文:

To secure your REST API, we will have to do the following things:

1- Configure Spring Security and the database.

2- Configure the authorization server and resource server.(you need to Create an Authorization Server)

3- Get an access token and a refresh token.

4- Get a protected Resource (REST API) using an access token.

huangapple
  • 本文由 发表于 2020年8月9日 18:36:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/63325238.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定