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
<PackageReference Include="Mesa.OAuth" Version="1.0.1.1" />
<PackageVersion Include="Mesa.OAuth" Version="1.0.1.1" />
<PackageReference Include="Mesa.OAuth" />
paket add Mesa.OAuth --version 1.0.1.1
#r "nuget: Mesa.OAuth, 1.0.1.1"
#:package Mesa.OAuth@1.0.1.1
#addin nuget:?package=Mesa.OAuth&version=1.0.1.1
#tool nuget:?package=Mesa.OAuth&version=1.0.1.1
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
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:
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 | Versions 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. |
-
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.