的ASP.NET Web API的授权和认证 [英] ASP.NET Web API authorization and Authentication
问题描述
我试图建立一个安全的asp.net网页API。你可以找到很多的如何保护你的API的方式,但我想知道什么是最好的方法还是'行业标准'来实现这个对我的情况。
I'm trying to build a secure asp.net web api. You can find a lot of ways of how to secure your API, but I want to know what is the best way or the 'industry standard' to implement this for my case.
这是我的要求
- 该API将通过为网站/移动应用等少数第三方开发人员使用
- 谁想要使用这个API开发人员可以给予一键访问API(授权)
- 网友(游客/消费者)必须登录到第三方应用程序,看看自己的个性化信息。
- 该API将使用ASP的会员数据库管理/认证用户
These are my requirements - The API will be used by a small number of third-party developers for websites/mobile apps etc. - Developers who want to use this API have to be given a key to access the API (Authorization) - Users (Visitors/consumers) have to login into the third-party apps to see their personalized information. - The API will use an ASP membership database for managing/authenticating the users.
我知道这是可以使用HTTP基本身份验证来验证用户,但如何实现API授权的一部分?
I know it's possible to use http basic authentication for authenticating users, but how do I implement the authorization part of the API?
时的OAuth 2.0的解决方案?
Is OAuth 2.0 a solution?
推荐答案
有是描述与认证/授权一篇非常好的文章令牌/键:
There is a very good article describing the authentication/authorization with token/key:
- Making your ASP.NET Web API’s secure
还介绍了有关的ASP.NET Web API安全等一些好的做法。
It also describes some other good practices regarding ASP.NET Web API security.
这篇关于的ASP.NET Web API的授权和认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!