Mesa.OAuth 1.0.1.1

dotnet add package Mesa.OAuth --version 1.0.1.1
                    
NuGet\Install-Package Mesa.OAuth -Version 1.0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mesa.OAuth" Version="1.0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mesa.OAuth" Version="1.0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Mesa.OAuth" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mesa.OAuth --version 1.0.1.1
                    
#r "nuget: Mesa.OAuth, 1.0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mesa.OAuth@1.0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mesa.OAuth&version=1.0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Mesa.OAuth&version=1.0.1.1
                    
Install as a Cake Tool

Introduction

The Mesa.OAuth project is a library for creating both OAuth consumers and providers on .NET. It currently targets the .NET 8, 9 and 10, and is written in C#.

Status

.NET

What is OAuth

The definition (from wikipedia) is:

OAuth is an open protocol that allows users to share their private resources (e.g. photos, videos, contact lists) stored on one site with another site without having to hand out their username and password.

OAuth provides a standardised way to handle delegated Authentication through a series of exchanges, called an authentication flow:

OAuth authentication flow

What's supported

The Mesa.OAuth library currently supports building consumers (clients) and providers (servers) for both OAuth 1.0 and 1.0a.

The library is designed to be used in both web applications and thick client apps.

Quick Consumer Example

X509Certificate2 certificate = TestCertificates.OAuthTestCertificate();

string requestUrl = "https://www.google.com/accounts/OAuthGetRequestToken";
string userAuthorizeUrl = "https://www.google.com/accounts/accounts/OAuthAuthorizeToken";
string accessUrl = "https://www.google.com/accounts/OAuthGetAccessToken";
string callBackUrl = "http://www.mysite.com/callback";

var consumerContext = new OAuthConsumerContext
{
    ConsumerKey = "weitu.googlepages.com",
    SignatureMethod = SignatureMethod.RsaSha1,
    Key = certificate.PrivateKey
};

var session = new OAuthSession(consumerContext, requestUrl, userAuthorizeUrl, accessUrl)
    .WithQueryParameters(new { scope = "http://www.google.com/m8/feeds" });

// get a request token from the provider
IToken requestToken = session.GetRequestToken();

// generate a user authorize url for this token (which you can use in a redirect from the current site)
string authorizationLink = session.GetUserAuthorizationUrlForToken(requestToken, callBackUrl);

// exchange a request token for an access token
IToken accessToken = session.ExchangeRequestTokenForAccessToken(requestToken);

// make a request for a protected resource
string responseText = session.Request().Get().ForUrl("http://www.google.com/m8/feeds/contacts/default/base").ToString();

Downloads/Releases

You can find it on Nuget.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1.1 99 12/31/2025
1.0.1 93 12/28/2025
1.0.0 96 12/28/2025