VNS.MitID
1.0.8
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package VNS.MitID --version 1.0.8
NuGet\Install-Package VNS.MitID -Version 1.0.8
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="VNS.MitID" Version="1.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VNS.MitID --version 1.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VNS.MitID, 1.0.8"
#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 VNS.MitID as a Cake Addin #addin nuget:?package=VNS.MitID&version=1.0.8 // Install VNS.MitID as a Cake Tool #tool nuget:?package=VNS.MitID&version=1.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
VNS MitID
Simple integration to Nets and Criipto MitID
Installation
Use the package manager nuget to install.
dotnet add package VNS.MitID
Usage
string _authorityUrl = "";
string _clientId = "";
string _clientSecret = "";
string _redirectUrl = "";
// Init and load discovery info
var mitId = new MitID(_authorityUrl, _clientId, _clientSecret, _redirectUrl);
// Returns a login url
Console.WriteLine(mitId.GetLoginUrl());
var _code = ""; // This code will be returned in the querystring to the redirectUrl
// Get the diffrent tokens
var tokens = mitId.GetTokens(_code);
Console.WriteLine(tokens.Id);
Console.WriteLine(tokens.Access);
Console.WriteLine(tokens.Userinfo); // This is only available with Nets
Console.WriteLine(tokens.ToString()); // Will return the RAW json result
// Get users info
var user = mitId.GetUserInfo(tokens);
Console.WriteLine(user.Id);
Console.WriteLine(user.SSN);
Console.WriteLine(user.Name);
Console.WriteLine(user.Age);
Console.WriteLine(user.Birthday);
Console.WriteLine(user.ToString()); // Will return the RAW json result
// Returns a logout url
// OBS. Remember to kill any sessions you have made with user object etc.
Console.WriteLine(mitId.GetLogoutUrl(user, "https://domain.com/you_are_now_logged_out.html"));
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- Newtonsoft.Json (>= 13.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.