AspNetCore.Authentication.SK.IdCard
1.0.0-alpha1
See the version list below for details.
dotnet add package AspNetCore.Authentication.SK.IdCard --version 1.0.0-alpha1
NuGet\Install-Package AspNetCore.Authentication.SK.IdCard -Version 1.0.0-alpha1
<PackageReference Include="AspNetCore.Authentication.SK.IdCard" Version="1.0.0-alpha1" />
paket add AspNetCore.Authentication.SK.IdCard --version 1.0.0-alpha1
#r "nuget: AspNetCore.Authentication.SK.IdCard, 1.0.0-alpha1"
// Install AspNetCore.Authentication.SK.IdCard as a Cake Addin #addin nuget:?package=AspNetCore.Authentication.SK.IdCard&version=1.0.0-alpha1&prerelease // Install AspNetCore.Authentication.SK.IdCard as a Cake Tool #tool nuget:?package=AspNetCore.Authentication.SK.IdCard&version=1.0.0-alpha1&prerelease
AspNetCore.Authentication.SK.IdCard
AspNetCore.Authentication.SK.IdCard is a ID-card security middleware that you can use in your ASP.NET Core application to support SK ID-card authentication. It is inspired by Microsoft Certificate authentication. It is not perfect, but functional as external authentication.
The first alpha release can be found on NuGet.
Getting started
Install live or demo SK root CA and intermediate certificates to your running computer or server from SK site. They have to be installed in propriate stores or received user certifiactes are not validated.
Authentication flow requires to redirect user to host that requires client certificate in TLS level. For that sample uses same application on different port, but it is also possible to use subdomain instead.
Configure your hosting environenment with additionally listen https with client certificate. Eg. add following lines to your CreateHostBuilder
:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.ConfigureKestrel(options =>
{
options.ListenLocalhost(5000);
options.ListenLocalhost(5001, listenOptions => listenOptions.UseHttps());
options.ListenLocalhost(5002, listenOptions =>
{
listenOptions.UseHttps(adapterOptions =>
{
adapterOptions.ClientCertificateMode = ClientCertificateMode.RequireCertificate;
});
});
});
});
Add following lines to your Startup
class:
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication()
.AddIdCard(options =>
{
options.MainSite = "https://localhost:5001";
options.AuthenticationSite = "https://localhost:5002";
})
}
public void Configure(IApplicationBuilder app)
{
app.UseAuthentication();
app.UseAuthorization();
app.UseIdCardAuthentication();
}
See the /sample directory for a complete sample using ASP.NET Core MVC.
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. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Microsoft.AspNetCore.Authentication.Certificate (>= 3.1.10)
- Rfc2253 (>= 1.0.0)
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.0.0-alpha2 | 241 | 1/22/2021 |
1.0.0-alpha1 | 198 | 1/19/2021 |