What is the best OAuth2 C# library? [closed]
Asked Answered
K

4

78

It seems like many app providers are using OAuth2 to allow API access, such as Twitter and Facebook. Does anyone use a good library to do OAuth2 processing that is general enough to use across all applications?

Kudva answered 2/9, 2010 at 20:52 Comment(4)
I'm confused by the vote to close. Asking for library recommendations to accomplish a specific task is now "subjective and argumentative"?Dromond
Some people for some reason think that any idea of "best" and "worst" is completely non-objective. I have no idea why, but they think "green is the best color!!!!" is the same as "what is the best library given these conditions: ..."Inform
There is also the Microsoft implementation based in Katana, nuget.org/packages/Microsoft.Owin.Security.OAuthBighead
I think there's an internal policy for all SO moderators to close "recommendation" questions b/c they're afraid to get google penalty for "thin content"Iselaisenberg
Z
27

I didn't look into it's internals (source code link is broken), but in general DotNetOpenAuth seems to be quite professional.

Update: OAuth 2 and OpenID are now supported as well.

Zeke answered 2/9, 2010 at 21:50 Comment(9)
Last I checked DotNetOpenAuth didn't support OAuth 2.0.Externality
@Externality you are right. I believe something was not paid attention to when I answered (maybe their design was different or they erroneously claimed OAUth2 support). I'll update the answer now.Miscellanea
Now (Febuary 2013) DotNetOpenAuth supports OAuth2 and OpenID.Mineraloid
@GrzegorzGierlik Thank you for the update. As people rarely read comments, I've put an update instead of your modification.Miscellanea
As I understood, it can't be used for commercial projects. I installed this library from NuGet and it asked me about license for Microsoft libraries (Microsoft.Bcl.dll and two others). Here is license microsoft.com/net/dotnet_library_license.htm with text "You may not use the software for commercial software hosting services." Please, correct me if I'm wrongHoekstra
@Hoekstra I am not the developer of that library so I can only guess. The homepage states "It’s completely free to use on personal and commercial projects" . I think the best approach would be to contact the author of the library and ask explicitly.Miscellanea
I highly not recommend using DNOA. There is almost no documentation on how to use the library so you will definitely be on your own whenever you face any issues. If the web service you are trying to access has a .NET SDK which includes an OAuth implementation then go for that. A personal advice for which I payed a high price, don't go for DNOA otherwise get ready to have restless nights reading through the code alone!Narcosynthesis
Source code link isn't broken anymore.Lingo
What about the IdentityServer4?Pneumoconiosis
L
22

You should look on OAuth2. It is .NET implementation of OAuth 1.0 and OAuth 2.0 protocol for most of the popular providers:

  • google
  • facebook
  • twitter
  • foursquare
  • instagram
  • linked-in
  • windows live
  • vkontakte
  • odnoklassniki
  • yandex
  • mail.ru
  • github

Nuget package is there.

Lapboard answered 22/9, 2012 at 6:27 Comment(1)
Do we have any detailed working example of this library ? I can see some usage examples showed but I am not understanding like what is AuthroizationRootExempt
P
7

I haven't seen any good frameworks out there yet for OAuth2. I've decided to try and roll my own for a project.

My framework so far supports bearer tokens and all of the oauth 2 flows (challenge/response, implicit, client credential, resource owner password, and refresh token).

It's a little clunky, and I'm working on my first REST service built on this framework.

Check it out, any feedback or contributions would be appreciated.

https://github.com/ghorsey/SharpOAuth2

Petunia answered 28/5, 2011 at 3:38 Comment(0)
A
1

I would look at the Hammock REST client library. It is general purpose REST client, but it provides OAuth support as well.

Adjuvant answered 6/9, 2010 at 16:10 Comment(1)
Hammock REST doesn't support oAuth2. Only oAuth 1.0aDehydrogenate

© 2022 - 2024 — McMap. All rights reserved.