OAuth的2.0版结合ASP.NET MVC 4的Web API [英] OAuth v2.0 in combination with ASP.NET MVC 4 Web API

查看:198
本文介绍了OAuth的2.0版结合ASP.NET MVC 4的Web API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图构建一个使用OAuth的2个标准,其中Web API和通信,以我现有的应用程序来验证用户的Web API。 因此,我想设置一个的OAuth 2服务器/服务,检查用户使用具有用户和角色我现有的应用程序。 不幸的是,我不能得到如何建立一个良好的/简单的例子,这样的服务。所以,我的问题是你有例子​​或更好的想法来验证 我的用户?

I’m trying to build a Web API that uses the oauth 2 standard to authenticate users with my existing application where the Web API communicates with. Therefore I want to setup a oauth 2 server/service that checks the users with my existing applications that has users and roles. Unfortunately I can’t get a good/simple example of how to setup a service like that. So my question is do you have examples or better ideas to authenticate my users?

推荐答案

我不太明白你的问题说实话,所以我不知道,如果你问一般的OAuth整合或如何找到一个OAuth的服务器到你的应用与集成。

I didn't quite understand your question to be honest, so I'm not sure if you're asking about general OAuth integration or how to find an OAuth server to integrate your app with.

我会带我的机会和大家分享一些搜索结果。希望这些将帮助。

I'll take my chance and share some search results with you. Hope these will help.

这是关于整合的OAuth的好文章。尽管提出来看一看 http://www.asp.net/identity 先得到一个更好的理解的OAuth和Asp.Net集成。

This is a good article about oauth integration. Although it suggests to take a look at http://www.asp.net/identity first to get a better understanding of OAuth and Asp.Net integration.

<一个href="http://blog.mszcool.com/index.php/2013/12/asp-net-4-5-1-webapi-general-integration-with-oauth2-and-oauth-authentication-servers/">http://blog.mszcool.com/index.php/2013/12/asp-net-4-5-1-webapi-general-integration-with-oauth2-and-oauth-authentication-servers/

可以看出在后,这种流动可以引导你实现你自己的OAuth服务器,然后你可以用你的WebAPI集成。

As seen in the post, this flow can guide you to implement your own OAuth server and then you can integrate it with your WebApi.

还有这篇文章:<一个href="http://www.developerfusion.com/article/147914/protecting-your-aspnet-web-api-using-oauth2-and-the-windows-azure-access-control-service/">http://www.developerfusion.com/article/147914/protecting-your-aspnet-web-api-using-oauth2-and-the-windows-azure-access-control-service/

这其中有以下标题:

  • 为什么我需要一个API
  • API特性
  • 在ASP.NET构建API
  • 开始了解OAuth2
  • 在Windows Azure的访问控制服务
  • 在消费使用OAuth2保护的API
  • 在建筑使用OAuth2(和Windows Azure的ACS)保护的API

最后,以便后期可能有帮助。它是关于在的WebAPI使用OAuth认证。

And finally this SO post might be helpful as well. It is about authentication using OAuth in WebApi.

祝你好运!

修改

既然你说你想实现自己的OAuth的服务器我加入有关的OAuth 1.0协议的一对夫妇更多的参考资料。

Since you said you want to implement your own OAuth server I'm adding a couple more references about OAuth 1.0 protocol.

RFC 5849的OAuth 1.0协议并有这样的指南,可以帮助你得到一个更好的理解OAuth的认证流程的。 在这里输入链接的描述

RFC 5849 OAuth 1.0 Protocol and there is this guide which might help you get a better understanding of OAuth workflow. enter link description here

对于实施的一部分,我不是这方面的专家,但是,你首先需要阅读和理解OAuth协议,使自己的OAuth服务器可以通用于其他OAuth的客户和你实际执行的OAuth。在了解了OAuth协议本身,你可以$ C你的服务器P $ ptty的多$ C $你喜欢的方式。

As for the implementing part, I'm not an expert on that but, you first need to read and understand OAuth protocol so that your own OAuth server can be generic to other OAuth clients and you're actually implementing OAuth. After you understand the OAuth protocol itself, you can pretty much code your server the way you like.

希望这额外的信息也有帮助。

Hope this extra information helps too.

这篇关于OAuth的2.0版结合ASP.NET MVC 4的Web API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆