![]() |
VOOZH | about |
dotnet add package OAuth2 --version 1.0.0
NuGet\Install-Package OAuth2 -Version 1.0.0
<PackageReference Include="OAuth2" Version="1.0.0" />
<PackageVersion Include="OAuth2" Version="1.0.0" />Directory.Packages.props
<PackageReference Include="OAuth2" />Project file
paket add OAuth2 --version 1.0.0
#r "nuget: OAuth2, 1.0.0"
#:package OAuth2@1.0.0
#addin nuget:?package=OAuth2&version=1.0.0Install as a Cake Addin
#tool nuget:?package=OAuth2&version=1.0.0Install as a Cake Tool
OAuth2 is a library for user authentication using third-party services (OAuth/OAuth2 protocol) such as Google, Facebook and so on.
Install the OAuth2 NuGet package:
dotnet add package OAuth2
using System.Collections.Specialized;
using OAuth2.Client.Impl;
using OAuth2.Configuration;
using OAuth2.Infrastructure;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
// Helper to create a GoogleClient instance
GoogleClient CreateGoogleClient()
{
return new GoogleClient(new RequestFactory(), new ClientConfiguration
{
ClientId = app.Configuration["Google:ClientId"]!,
ClientSecret = app.Configuration["Google:ClientSecret"]!,
RedirectUri = "https://localhost:5001/auth/google/callback",
Scope = "profile email"
});
}
// Step 1: Redirect the user to Google's login page
app.MapGet("/auth/google", async () =>
{
var client = CreateGoogleClient();
var loginUri = await client.GetLoginLinkUriAsync();
return Results.Redirect(loginUri);
});
// Step 2: Handle the callback after authentication
app.MapGet("/auth/google/callback", async (HttpContext context) =>
{
var code = context.Request.Query["code"].ToString();
if (string.IsNullOrEmpty(code))
return Results.BadRequest("Missing authorization code.");
var client = CreateGoogleClient();
var userInfo = await client.GetUserInfoAsync(new NameValueCollection { { "code", code } });
return Results.Ok(new
{
userInfo.Id,
userInfo.FirstName,
userInfo.LastName,
userInfo.Email,
AvatarUri = userInfo.AvatarUri?.ToString()
});
});
app.Run();
| Provider | Client Class | Status | API Version | Auth Endpoint | Last Verified | Docs |
|---|---|---|---|---|---|---|
| GitHub | GitHubClient |
Active | REST (default: 2022-11-28) | github.com/login/oauth/authorize |
2026-04-23 | Docs |
GoogleClient |
Active | OAuth2 v2 / UserInfo v3 | accounts.google.com/o/oauth2/v2/auth |
2026-04-23 | Docs | |
FacebookClient |
Active | Graph API v25.0 | www.facebook.com/v25.0/dialog/oauth |
2026-04-23 | Docs | |
| Microsoft | MicrosoftClient |
Active | Identity Platform v2.0 / Graph v1.0 | login.microsoftonline.com/common/oauth2/v2.0/authorize |
2026-04-23 | Docs |
| Asana | AsanaClient |
Active | API v1 | app.asana.com/-/oauth_authorize |
2026-04-23 | Docs |
| DigitalOcean | DigitalOceanClient |
Active | OAuth 2.0 | cloud.digitalocean.com/v1/oauth/authorize |
2026-04-23 | Docs |
| ExactOnline | ExactOnlineClient |
Active | REST API v1 | start.exactonline.nl/api/oauth2/authorize |
2026-04-23 | Docs |
| Fitbit | FitbitClient |
Active | Web API v1 (user profile) | www.fitbit.com/oauth2/authorize |
2026-04-23 | Docs |
| Foursquare | FoursquareClient |
Deprecated | v2 (OAuth deprecated) | foursquare.com/oauth2/authorize |
2026-04-23 | Docs |
LinkedInClient |
Active | OAuth v2 (OpenID Connect) | www.linkedin.com/oauth/v2/authorization |
2026-04-23 | Docs | |
| LoginCidadao | LoginCidadaoClient |
Unknown | OpenID Connect v2 | logincidadao.rs.gov.br/openid/connect/authorize |
2026-04-23 | |
| MailRu | MailRuClient |
Active | OAuth 2.0 | connect.mail.ru/oauth/authorize |
2026-04-23 | Docs |
| Odnoklassniki | OdnoklassnikiClient |
Active | OAuth 2.0 | www.odnoklassniki.ru/oauth/authorize |
2026-04-23 | Docs |
| Salesforce | SalesforceClient |
Active | OAuth 2.0 (Web Server Flow) | login.salesforce.com/services/oauth2/authorize |
2026-04-23 | Docs |
| Spotify | SpotifyClient |
Active | Web API v1 | accounts.spotify.com/authorize |
2026-04-23 | Docs |
| Todoist | TodoistClient |
Active | REST API v1 | app.todoist.com/oauth/authorize |
2026-04-23 | Docs |
| X (Twitter) | XClient |
Active | OAuth 1.0a / API v1.1 | api.twitter.com/oauth/authenticate |
2026-04-23 | Docs |
| Uber | UberClient |
Active | OAuth v2 | auth.uber.com/oauth/v2/authorize |
2026-04-23 | Docs |
| VK (Vkontakte) | VkClient |
Active | API v5.131 | oauth.vk.com/authorize |
2026-04-23 | Docs |
| VSTS (Azure DevOps) | VSTSClient |
Deprecated (2026) | Azure DevOps OAuth (deprecated Apr 2025) | app.vssps.visualstudio.com/oauth2/authorize |
2026-04-23 | Docs |
| Windows Live | WindowsLiveClient |
Legacy (Working) | Live SDK v5.0 | login.live.com/oauth20_authorize.srf |
2026-04-23 | Migration Guide |
| Yahoo | YahooClient |
Active | OAuth 2.0 | api.login.yahoo.com/oauth2/request_auth |
2026-04-23 | Docs |
| Yandex | YandexClient |
Active | OAuth 2.0 (Yandex ID) | oauth.yandex.ru/authorize |
2026-04-23 | Docs |
Removed providers (Instagram, Xing): These providers' APIs have been retired or shut down. The client classes have been removed.
- Instagram: Basic Display API shut down Dec 4, 2024. There is no consumer OAuth replacement — the remaining Instagram APIs are business/creator-only. Announcement
- Xing: OAuth 1.0a REST API discontinued. dev.xing.com only hosts plugins.
Renamed providers:
TwitterClient→XClient(Twitter rebranded to X). The old class name is preserved as an obsolete derived class that produces a compiler error directing users to the new name.Legacy (Working):
WindowsLiveClient— Microsoft officially retired the Live SDK in Nov 2018 but the endpoints continue to function in production. Confirmed working in Exceptionless. For new integrations, useMicrosoftClient(Microsoft Identity Platform v2.0 + Graph). User IDs differ between the two platforms.Deprecated providers:
- Foursquare: v2 consumer OAuth API deprecated. The replacement Places API v3 uses API keys, not OAuth.
- VSTS (Azure DevOps): Azure DevOps OAuth stopped accepting new app registrations in April 2025 and is scheduled for full retirement in 2026. Use
MicrosoftClientwith Microsoft Entra ID OAuth instead
Many thanks to JetBrains company for providing free OSS licenses for ReSharper and dotCover - these tools allow us to work on this project with pleasure!
Also we glad to have opportunity to use free Teamcity CI server provided by Codebetter.com and JetBrains - many thanks for supporting OSS!
OAuth2 optimization would never be so simple without YourKit .NET profiler! We appreciate kind support of open source projects by YourKit LLC - the creator of innovative and intelligent tools for profiling .NET YourKit .NET Profiler and Java applications YourKit Java Profiler.
The MIT License (MIT) Copyright (c) 2012-2013 Constantin Titarenko, Andrew Semack and others
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on OAuth2:
| Package | Downloads |
|---|---|
|
BotAuth.GenericOAuth2
This package is a generic OAuth2 authentication provider for using with the BotAuth package in a Bot Framework/BotBuilder Project. |
|
|
TQLApp.Plugins.GitHub
Techie's Quick Launcher plugin for GitHub. |
|
|
DashAPI
A client library for the Dash API's |
|
|
Vern.Social
Vern Social |
|
|
Vern.Social.Umbraco7
Social |
Showing the top 1 popular GitHub repositories that depend on OAuth2:
| Repository | Stars |
|---|---|
|
exceptionless/Exceptionless
Exceptionless application
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 1,682 | 5/11/2026 |
| 1.0.0-beta1 | 389 | 4/24/2026 |
| 0.10.3 | 55,349 | 2/25/2023 |
| 0.10.2 | 66,289 | 10/18/2021 |
| 0.10.1 | 63,090 | 10/12/2020 |
| 0.10.0 | 3,217 | 9/2/2020 |
| 0.9.13-pre | 32,132 | 11/8/2018 |
| 0.9.12-pre | 44,894 | 1/9/2018 |
| 0.9.11-pre | 2,811 | 11/10/2017 |
| 0.9.10-pre | 2,352 | 11/7/2017 |
| 0.9.8-pre | 2,317 | 10/6/2017 |
| 0.8.40 | 98,478 | 9/3/2016 |
| 0.8.38 | 2,346 | 8/31/2016 |
| 0.8.37 | 17,480 | 6/10/2016 |
| 0.8.36 | 15,035 | 10/22/2015 |
| 0.8.35 | 3,101 | 9/27/2015 |
| 0.8.34 | 26,814 | 7/31/2014 |
| 0.8.33 | 2,335 | 7/28/2014 |
| 0.8.32 | 2,626 | 6/30/2014 |
| 0.8.31 | 2,465 | 6/23/2014 |