【发布时间】:2020-12-18 03:53:28
【问题描述】:
假设我创建了自己的应用程序。我们将前端和 RESTful API 作为后端做出反应,并且我们正在使用 Google OAuth 对我们的用户进行授权。前端正在调用 API。前端使用 OAuth 的授权码流。从 Google OAuth 服务器获取访问令牌后,前端使用此令牌调用我的后端。
现在恶意用户将从 Chrome 网络选项卡获取我的 API 的 URL、REST API 所需的其他信息,并且可以使用访问令牌直接调用 API。
问题:
How will my REST API know from where the request is coming?
Also how it will validate the access token?
Is it possible once User got all information about my REST API, it can call directly with fake access token?
我查看了授权代码流的图表。下面是链接。 https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-app-types
But how will web api validate the token?
如果我缺少一些信息,请指导我。
【问题讨论】: