Create an OAuth 2.0 service provider using DotNetOpenAuth

房东的猫 提交于 2019-12-20 23:29:02

问题


I'm building a web app which will have an api and an authorization service using DotNetOpenAuth. I found this example on how you can authorize using a service provider that already exists but I would like an example on how to implement a service provider that can create tokens, persist them and do evaluation. Is there any great articles or sample providers that I can download?


回答1:


Update

DotNetOpenAuth has moved on since this was initially posted. I strongly suggest you follow Ashish's advise and take a look at the samples. It contains code to write Authorization Servers, Resource Servers and Clients for all the major flows.

If you wanted a pre built solution, with opensource code

Thinktecture Identity Server is an Open Source .NET security token service. It supports a number of endpoints for authentication including OAuth 2.0 Bearer tokens.

Update this Thinktecture Identity Server is now on version 2 and supports these OAuth 2.0 flows

  1. Resource Owner Password Credential Flow
  2. Implict Flow & JavaScript
  3. Authorization Code Flow

again take a look at the code to see how it was all done and there are samples here to show how to plumb it in.

I hope this helps - these library's and examples have hugely helped us over the past few months.

Update

There is also another example warning, it looks dated of a simple OAuth provider for MVC here Sample code here




回答2:


There are complete working example for DotNetOpenAuth can be found here - https://github.com/DotNetOpenAuth/DotNetOpenAuth/tree/master/samples




回答3:


I tried a number of times with DNOA....had to give up, but documented my findings (used Thinktecture in the end)...http://tb-it.blogspot.co.nz/2015/06/oauth-20-frameworks-and-platforms.html



来源:https://stackoverflow.com/questions/11438517/create-an-oauth-2-0-service-provider-using-dotnetopenauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!