Applyze.Shared.Authentication.AspNetCore
1.0.6.2
See the version list below for details.
dotnet add package Applyze.Shared.Authentication.AspNetCore --version 1.0.6.2
NuGet\Install-Package Applyze.Shared.Authentication.AspNetCore -Version 1.0.6.2
<PackageReference Include="Applyze.Shared.Authentication.AspNetCore" Version="1.0.6.2" />
<PackageVersion Include="Applyze.Shared.Authentication.AspNetCore" Version="1.0.6.2" />
<PackageReference Include="Applyze.Shared.Authentication.AspNetCore" />
paket add Applyze.Shared.Authentication.AspNetCore --version 1.0.6.2
#r "nuget: Applyze.Shared.Authentication.AspNetCore, 1.0.6.2"
#:package Applyze.Shared.Authentication.AspNetCore@1.0.6.2
#addin nuget:?package=Applyze.Shared.Authentication.AspNetCore&version=1.0.6.2
#tool nuget:?package=Applyze.Shared.Authentication.AspNetCore&version=1.0.6.2
Applyze.Shared.Authentication
This package includes AspNetCore 2.2 Authentication Attributes for Applyze Tenant.
Installation
NuGet Package
You can find NuGet Package and instructions from here
- Open Package Manager Console and run following command:
Install-Package Applyze.Shared.Authentication.AspNetCore
- Or just add following package reference to .csproj file:
<PackageReference Include="Applyze.Shared.Authentication" Version="1.0.4" />
<PackageReference Include="Applyze.Shared.Authentication.AspNetCore" Version="1.0.4" />
Set-Up
- Go to Startup.cs
- Add following code into ConfigureServices() method:
services.AddApplyzeAuthentication(builder => builder.SetTenantBaseUrl("test.com/v1"));
// or you can set it from your configuretion
services.AddApplyzeAuthentication(builder => builder.SetTenantBaseUrl(Configuration.GetSection("Applyze:TenantUrl").Value));
Usage
Authenticate with Attribute
There is an ApplyzeAuthenticateAttribute which is located at Applyze.Shared.Authentication.Filters namespace nad ready to use authenticate your Controllers or Actions.
Sample:
- Add following code into ConfigureServices() method:
//...
using Applyze.Shared.Authentication.Filters;
//...
[ApplyzeAuthenticate] // <-- Authenticates ApiKey from Tenant
public class YourController()
{
[AllowAnonymous] // <-- Authentication disabled for this action
public IActionResult YourAction()
{
//...
}
[ApplyzeAuthenticate(AuthenticationType.ApplicationLevel)] // <-- Authenticates ApiKey, AppKey
public IActionResult YourOtherAction()
{
//...
}
[ApplyzeAuthenticate(AuthenticationType.ApplicationOwnerLevel)] // <-- Authenticates ApiKey, UserApiKey and AppKey from Tenant
public IActionResult YourAnotherAction()
{
//...
}
}
Or you can combine your own requirements with bitwise OR like following sample:
[ApplyzeAuthenticate(AuthenticationType.ApiKey | AuthenticationType.UserApiKey | AuthenticationType.AppKey)]
Getting Authenticated App
//...
using Applyze.Shared.Authentication.Helpers;
//...
[ApplyzeAuthenticate(AuthenticationType.ApplicationLevel)]
public class YourController()
{
public IActionResult YourAction()
{
var app = HttpContext.GetCachedApp();
Console.WriteLine(app.Name);
//...
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.2
- Applyze.Shared.Authentication (>= 1.0.6.2)
- Microsoft.AspNetCore (>= 2.2.0)
- Microsoft.AspNetCore.Mvc (>= 2.2.0)
- Microsoft.Extensions.Caching.Memory (>= 2.2.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Applyze.Shared.Authentication.AspNetCore:
| Package | Downloads |
|---|---|
|
Applyze.Shared.Authorization.AspNetCore
AspNetCore Implementation of Applyze Authorization |
|
|
Applyze.Web.AspNetCore.Resolver
This Library connection string resolver for AspNetCore. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.11.0 | 1,149 | 11/13/2020 |
| 2.11.0-pratikislem | 180 | 6/27/2024 |
| 2.10.1 | 667 | 10/16/2020 |
| 2.10.0 | 636 | 10/14/2020 |
| 2.9.0-pre.1 | 446 | 7/17/2020 |
| 2.8.1-pre.4 | 411 | 7/17/2020 |
| 2.8.1-pre.3 | 418 | 7/17/2020 |
| 2.8.1-pre.2 | 424 | 7/17/2020 |
| 2.8.1-pre.1 | 430 | 7/17/2020 |
| 2.8.0 | 2,091 | 5/13/2020 |
| 2.7.0 | 769 | 5/8/2020 |
| 2.6.1 | 759 | 5/8/2020 |
| 2.6.0 | 743 | 5/8/2020 |
| 2.5.0 | 693 | 5/8/2020 |
| 2.4.0 | 1,222 | 4/20/2020 |
| 2.3.3 | 697 | 4/7/2020 |
| 2.3.2 | 706 | 4/7/2020 |
| 2.3.1 | 693 | 4/7/2020 |
| 2.3.0 | 694 | 4/7/2020 |
| 1.0.6.2 | 866 | 7/24/2019 |
Released