What is the best OAuth2 C# library?
Solution 1
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.
Solution 2
You should look on OAuth2. It is .NET implementation of OAuth 1.0 and OAuth 2.0 protocol for most of the popular providers:
- foursquare
- linked-in
- windows live
- vkontakte
- odnoklassniki
- yandex
- mail.ru
- github
Nuget package is there.
Solution 3
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
Solution 4
I would look at the Hammock REST client library. It is general purpose REST client, but it provides OAuth support as well.
TruMan1
Updated on July 05, 2022Comments
-
TruMan1 almost 2 years
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?
-
cecilphillip over 13 yearsHammock REST doesn't support oAuth2. Only oAuth 1.0a
-
Micah almost 13 yearsLast I checked DotNetOpenAuth didn't support OAuth 2.0.
-
Eugene Mayevski 'Callback almost 13 years@Micah 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.
-
Grzegorz Gierlik about 11 yearsNow (Febuary 2013) DotNetOpenAuth supports OAuth2 and OpenID.
-
Eugene Mayevski 'Callback about 11 years@GrzegorzGierlik Thank you for the update. As people rarely read comments, I've put an update instead of your modification.
-
nraina over 9 yearsDo we have any detailed working example of this library ? I can see some usage examples showed but I am not understanding like what is AuthroizationRoot
-
white.zaz almost 9 yearsAs 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 wrong
-
Eugene Mayevski 'Callback almost 9 years@white.zaz 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.
-
GETah over 7 yearsI 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!
-
AlexMelw about 6 yearsSource code link isn't broken anymore.
-
Faither about 3 yearsWhat about the
IdentityServer4
?