[英]OWIN OAuth 2.0 Authorization Server
I have read the tutorial http://www.asp.net/aspnet/overview/owin-and-katana/owin-oauth-20-authorization-server and realized that this is what I really want to secure my web APIs. 我已经阅读了http://www.asp.net/aspnet/overview/owin-and-katana/owin-oauth-20-authorization-server教程,并意识到这是我真正想要保护Web API的安全。 so I downloaded the project code and added to my API's MVC project.
因此我下载了项目代码并将其添加到我API的MVC项目中。 Actually my project is divided into 2 parts, the MVC_application (for displaying data from web API's) and the MVC_API where my API's are configured.
实际上,我的项目分为两部分,MVC_application(用于显示来自Web API的数据)和配置了我的API的MVC_API。 so now I have three projects (MVC_application, MVC_API and AuthorizationServer)
所以现在我有三个项目(MVC_application,MVC_API和AuthorizationServer)
My question is: Howcan I link the AuthorizationServer to my project? 我的问题是:如何将AuthorizationServer链接到我的项目?
In other words: how do I tell the application to call AuthorizationServer before calling the MVC_API project to read the data? 换句话说:如何在调用MVC_API项目读取数据之前告诉应用程序调用AuthorizationServer?
You need to secure your web api project, and handle in your mvc project , unauthorized responses from your web api service. 您需要保护Web api项目的安全,并在mvc项目中处理来自Web api服务的未经授权的响应。 For call your web api, you need to call first to your authorization server , get the bearer token and include the header in your subsequent requests to your web api service.
要调用Web api,您需要先调用授权服务器 ,获取承载令牌并将标头包含在对Web api服务的后续请求中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.