VatsimSSO 1.3.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package VatsimSSO --version 1.3.0
NuGet\Install-Package VatsimSSO -Version 1.3.0
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="VatsimSSO" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VatsimSSO --version 1.3.0
#r "nuget: VatsimSSO, 1.3.0"
#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.
// Install VatsimSSO as a Cake Addin
#addin nuget:?package=VatsimSSO&version=1.3.0

// Install VatsimSSO as a Cake Tool
#tool nuget:?package=VatsimSSO&version=1.3.0

VATSIM SSO

An OAuth 1.0 wrapper designed to easily implement the VATSIM SSO system in C# web applications.

Installation

PM> Install-Package VatsimSSO

Dependencies will be pulled at the same time.

Implementation

Initial login token

The code below will return the login token used to authenticate the user when redirecting to the SSO server (BaseUrl property defaults to https://cert.vatsim.net/sso/api).

// Client object
VatsimSSO r = new VatsimSSO("CONSUMER_KEY", "CONSUMER_SECRET", "CALLBACK_URI");

// Get the request token
var RequestToken = r.GetRequestToken();

The object returned is a custom SSOAuthRequest object which returns the token and result information. A redirect example in ASP.NET would look like this:

return Redirect("https://cert.vatsim.net/sso/auth/pre_login/?oauth_token=" + RequestToken.Token.oauth_token);

You can return the raw JSON string by returning the Raw property of the object.

Returned user data

The below code will return a JSON string of the information for the user that has just logged in, using the access token, secret and verifier.

// Client object
VatsimSSO r = new VatsimSSO("CONSUMER_KEY", "CONSUMER_SECRET", Token: oauth_token, Verifier: oauth_verifier, TokenSecret: oauth_token_secret);

// Json string
string Results = r.ReturnData().Raw;

An example of such JSON response would be:

{"request":{"result":"success","message":""},"user":{"id":"1300007","name_first":"7th","name_last":"Test","rating":{"id":"7","short":"C3","long":"Senior Controller","GRP":"Senior Controller"},"pilot_rating":{"rating":"0"},"email":"noreply@vatsim.net","experience":"N","reg_date":"2014-05-14 17:17:26","country":{"code":"GB","name":"United Kingdom"},"region":{"code":"USA-S","name":"South America"},"division":{"code":"CAM","name":"Central America"},"subdivision":{"code":null,"name":null}}}

You can also return an SSOReturnData object. This object contains already parsed user and result information as a C# object. Example:

// Return data object
var Results = r.ReturnData();

Please open up an issue if there are any problems or feel free to post on the forum thread.

Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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

Updated to work in production, code refactored and updated.