CSTP.UserAuthenticator 1.4.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package CSTP.UserAuthenticator --version 1.4.5                
NuGet\Install-Package CSTP.UserAuthenticator -Version 1.4.5                
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="CSTP.UserAuthenticator" Version="1.4.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CSTP.UserAuthenticator --version 1.4.5                
#r "nuget: CSTP.UserAuthenticator, 1.4.5"                
#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 CSTP.UserAuthenticator as a Cake Addin
#addin nuget:?package=CSTP.UserAuthenticator&version=1.4.5

// Install CSTP.UserAuthenticator as a Cake Tool
#tool nuget:?package=CSTP.UserAuthenticator&version=1.4.5                

Logo

CSTP User Authenticator

CSTP User Authentication is a secure and reliable nuget package designed and developed by ( Central Securities Clearing System Plc ) engineers to manage user authentication processes within our CSTP eco system.

Features

- User Authentication on CSTP.
- HttpContext Extension

Installation

 1. Right click on the target project.
 2. Select manage nuget packages.
 3. Search for "CSTP.UserAuthenticator" (without the quote).
 4. Click Install and follow the prompt.

OR

Run the following command in the nuget manager console with the target project selected

 1. nuget install CSTP.UserAuthenticator.

Usage/Examples

authorization
Add the attribute [CSTPAuthorizationAttribute] on any endpoint you want to authenticate.
Note:the endpoint must have been enlisted on CSCS CSTP
Getting Authentication response in controller
To get the response from the validation consider the code below :

var yourVariableName = HttpContext.GetCSTPValidationResponse();

below is the sample response object that will be returned from the above method call

    public class ApiUserValidationResponse
    {
        public string ResponseCode { get; set; }
        public string Message { get; set; }
        public string token_type { get; set; }
        public string userName { get; set; }
        public string expires_in { get; set; }
        public string ext_expires_in { get; set; }
        public string access_token { get; set; }
        public RightsPrivilagesResponseDTO? Privilages { get; set;}
    }

    public class RightsPrivilagesResponseDTO
    {
        public List<RightsPrivilages>? RightsAccess { get; set; }
        public string? ResponseCode { get; set; }
        public string? Message { get; set; }
    }

    public class RightsPrivilages
    {
        public string? GroupName { get; set; }
        public string? SGroupName { get; set; }
        public string? RightObjects { get; set; }
        public Guid? ProductUID { get; set; }
    }

HTTPContext Extenstion
As an additional feature you can utilize the HTTPContext extension written to set or get an already 
set to the HTTPContext

- HttpContext.SetObject(string key, object item); //To set an item.
- HttpContext.GetObject(string key) //To get already set item.

License

[MIT](https://choosealicense.com/licenses/mit/)
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.

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.5.0 118 5/12/2024
1.4.5 109 5/12/2024
1.4.4 100 5/12/2024
1.4.3 99 5/12/2024
1.4.2 86 5/12/2024
1.4.1 125 4/9/2024
1.4.0 132 4/8/2024
1.3.9 116 4/7/2024
1.3.8 122 4/7/2024
1.3.7 108 4/7/2024
1.3.6 113 4/7/2024
1.3.5 105 4/7/2024
1.3.4 107 4/7/2024
1.3.3 119 4/7/2024
1.3.2 122 4/7/2024
1.3.1 125 4/7/2024
1.3.0 107 4/7/2024
1.0.4 139 4/7/2024
1.0.2 111 4/7/2024
1.0.1 127 3/25/2024
1.0.0 124 3/25/2024

First Release