ANT.AuthClient
1.0.0
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 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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:
- Commands
- Actions
- Profiles
- VerificationType
- 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 | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.AspNetCore.Authorization (>= 7.0.10)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.AspNetCore.Mvc.Abstractions (>= 2.2.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.