ANT.AuthClient 1.0.0

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

// Install ANT.AuthClient as a Cake Tool
#tool nuget:?package=ANT.AuthClient&version=1.0.0

Client

The client use a configuration that need to be added in the appsettings of the application where defines the client information:

"OAuthConfiguration": {
    "enabled": true,
    "authorization": {
      "profiles": {
        "prefix": ""
      },
      "commands": {
        "prefix": ".*"
      },
      "actions": {
        "prefix": ""
      }
    },
    "audiences": [
      {
        "audience": {
          "_id": "099153c2625149bc8ecb3e85e03f0022",
          "_encryptionKey": "IxrAjDoa2FqElO7IhrSrUJELhUckePEPVpaePlS_Xaw",
          "_issuer": "ANT.AuthServer"
        }
      }
    ]
  }

ANT.ClienAuth

ClientAuth is a library to use in other projects to be able to customize the Authorization with different parameters, this parameters match with the information generated for the token on the server. These parameters are:

  1. Commands
  2. Actions
  3. Profiles
  4. VerificationType
  5. ParameterToVerify

ANT.AuthServer.ClientTest

ANT Auth Client for NETCore WebApp

Add the services in DI

var builder = WebApplication.CreateBuilder(args);

// Replace the default authorization policy provider with our own
// custom provider which can return authorization policies for given
// policy names (instead of using the default policy provider)
builder.Services.AddSingleton<IAuthorizationPolicyProvider, CustomPolicyProvider>();

// As always, handlers must be provided for the requirements of the authorization policies
builder.Services.AddSingleton<IAuthorizationHandler, CustomAuthorizationHandler>();

builder.Services.AddSingleton<IAuthorizationHelper, AuthorizationHelper>();

builder.Services.AddMvc();

Call the API with Attributes:

[HttpGet(Name = "GetWeatherForecastUnauthorized")]
[CustomAuthorize(Commands =AuthenticationCodes.TEST)]
{
  ///...
}

[HttpGet(Name = "GetWeatherForecastAuthorized")]
[CustomAuthorize(Commands=AuthenticationCodes.ANTCITY001)]
{
  ...
}
"OAuthConfiguration": {
    "enabled": true,
    "authorization": {
      "profiles": {
        "prefix": ""
      },
      "commands": {
        "prefix": ".*"
      },
      "actions": {
        "prefix": ""
      }
    },
    "audiences": [
      {
        "audience": {
          "_id": "099153c2625149bc8ecb3e85e03f0022",
          "_encryptionKey": "IxrAjDoa2FqElO7IhrSrUJELhUckePEPVpaePlS_Xaw",
          "_issuer": "ANT.AuthServer"
        }
      }
    ]
  }
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
2.0.1 140 3/7/2024
2.0.0 97 3/6/2024
1.1.1 88 3/5/2024
1.1.0 356 8/15/2023
1.0.0 122 8/15/2023