如何实现在ASP.NET MVC 5的oauth2服务器和Web API 2 [英] How to implement oauth2 server in ASP.NET MVC 5 and WEB API 2
问题描述
首先,我将勾画我的项目:
First I'll sketch my project:
有关我的实习船,我需要将功能添加到现有的系统。一旦他被通过的oauth2用户授权的第三方客户端必须能够从AX Web服务访问数据。我知道我需要做一个代理Web服务向其中客户端可以使他的电话和调用AX服务,但我对的oauth2部分有点不确定。大多数的教程和指南是关于使用ASP.NET的身份对Facebook或谷歌登录。我不需要,我需要,所以我需要让我自己的oauth2服务使用现有凭据。
For my intern ship I need to add functionality to an existing system. A 3rd party client must be able to access data from AX web services once he is authorised by the user via oauth2. I understand that I need to make a 'proxy web service' whereto the client can make his calls and that calls the AX services but I am a bit unsure about the oauth2 part. Most tutorials and guides are about using ASP.NET's Identity for facebook or google logins. I don't need that, I need to use existing credentials so I need to make my own oauth2 service.
我觉得很难找到这个教程,指南或解释。我理解的oauth2什么需要做的,但我从来没有做过这样的事,很难启动。最接近我需要什么,我发现这是 GitHub库链接,但解决方案不建。
I find it hard to find tutorials, guides or explanations on this. I understand oauth2 and what needs to be done, but I have never done such a thing before and find it hard to start. The closest thing to what I need that I found is this github repo link, but the solution does not build.
我脑子里想的是什么使一个ASP.NET MVC网站,客户端(第三方)可以注册自己和获得他们的客户的ID。使用ASP.NET API我想创造采取必要的标记和参数的API,然后访问的Dyn AX服务。
What I had in mind is making an ASP.NET MVC website where clients (3rd parties) can register themselves and acquire their client ID's. With ASP.NET API I wanted to create the API that take the required tokens and parameters, and then access the Dyn AX services.
这是正确的还是我完全错了吗?任何帮助或链接就建立自己的oauth2服务器/服务将是不错的。
Is this correct or am I entirely wrong? Any help or links regarding building your own oauth2 server/service would be nice.
推荐答案
有来自 Taiseer Joudeh一份详细的的步进一步的说明。
There is a brilliant blog post from Taiseer Joudeh with a detailed step-by-step description.
- Part 1:采用的ASP.NET Web API 2基于令牌的身份验证,Owin和身份
- Part 2:AngularJS令牌认证使用的ASP.NET Web API 2,Owin和身份
- Part 3:使用ASP .NET的Web API 2启用AngularJS应用程序的OAuth刷新令牌,并Owin
- Part 4:的ASP.NET Web API 2外部登录与Facebook和谷歌在AngularJS应用
- Part 5:从资源服务器 解耦OWIN授权服务器
- Part 1: Token Based Authentication using ASP.NET Web API 2, Owin, and Identity
- Part 2: AngularJS Token Authentication using ASP.NET Web API 2, Owin, and Identity
- Part 3: Enable OAuth Refresh Tokens in AngularJS App using ASP .NET Web API 2, and Owin
- Part 4: ASP.NET Web API 2 external logins with Facebook and Google in AngularJS app
- Part 5: Decouple OWIN Authorization Server from Resource Server
这篇关于如何实现在ASP.NET MVC 5的oauth2服务器和Web API 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!