Security.Authentication.SingleSignOn 1.2.0

dotnet add package Security.Authentication.SingleSignOn --version 1.2.0
NuGet\Install-Package Security.Authentication.SingleSignOn -Version 1.2.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="Security.Authentication.SingleSignOn" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Security.Authentication.SingleSignOn --version 1.2.0
#r "nuget: Security.Authentication.SingleSignOn, 1.2.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 Security.Authentication.SingleSignOn as a Cake Addin
#addin nuget:?package=Security.Authentication.SingleSignOn&version=1.2.0

// Install Security.Authentication.SingleSignOn as a Cake Tool
#tool nuget:?package=Security.Authentication.SingleSignOn&version=1.2.0

this library is created to implement SSO on App.net MVC which supports .net framework 4.0

step 1: change web.config file

to use this library you will need to add below settings in appsettings

  <appSettings>
    <add key="SSO.LoginURI" value="" />
    <add key="SSO.TokenURI" value="" />
    <add key="SSO.ClientID" value="" />
    <add key="SSO.ClientSecret" value="" />
    <add key="SSO.TenantID" value="" />
    <add key="SSO.Scope" value="" />
    <add key="SSO.RedirectURI" value="" />
  </appSettings>

step 2: Add attribute to proctected resource.

after adding above settings need to add attribute to controller which needs to be authorized.

[SSOAuthenicate]
 public class HomeController : Controller
 {
 
 }

Note: if you do not want to use "SSOAuthenticate" attribute, below code can be used to implement OAuth authentication.

Authenticator.Instance.IsAuthenticated(httpContext);

step 3: reterive information of authenticated user.

to get all claims and related authenticated user information, you can wire this code :

var principal = HttpContext.User as SSOPrincipal;
if (principal != null)
{
  //principal.Claims : will have all claims which you can convert according to your need.
  //principal.Identity : will give all information regarding the identity like name,email,upn and everything.
    principal.
}
Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  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
1.2.0 375 7/16/2021
1.0.1 306 5/25/2021
1.0.0 288 5/21/2021

Bug fixes and performance improvements