EstonianAuthenticationProvider 1.1.3
dotnet add package EstonianAuthenticationProvider --version 1.1.3
NuGet\Install-Package EstonianAuthenticationProvider -Version 1.1.3
<PackageReference Include="EstonianAuthenticationProvider" Version="1.1.3" />
paket add EstonianAuthenticationProvider --version 1.1.3
#r "nuget: EstonianAuthenticationProvider, 1.1.3"
// Install EstonianAuthenticationProvider as a Cake Addin
#addin nuget:?package=EstonianAuthenticationProvider&version=1.1.3
// Install EstonianAuthenticationProvider as a Cake Tool
#tool nuget:?package=EstonianAuthenticationProvider&version=1.1.3
About
Download EstonianAuthenticationProvider from nuget packet manager https://www.nuget.org/packages/EstonianAuthenticationProvider/.
Solution works on ASP.NET Core web applications with implementation of .Net Core starting with version 2.0 or with implementation of .NET Framework starting with version 4.6.1 with SDK 2.x. To use full solution it is recommended to use MCV pattern but many methods can be used without.
To use ID-card functionality
Configure your webserver so that the server would ask for certificate. Solution works with IIS, Apache and Nginx. Some examples how to configure web server
Make new project (can be inside the same solution) so that it can be configured to ask for client certificate;
Make new Middleware class in that project and let it inherit the package CertificateAuthenticationHelper class;
Add your Middleware class into the pipleline by registering it in the Startup class, Configure method;
Also register classes CertificateValidationConfig and DigiDocServiceConfig in the Startup class, ConfigureService method. For example if you want to use Options patter JSON option it should look something like this:
services.Configure<CertificateValidalidationConfig>(Configuration.GetSection("CertificateValidation")); services.Configure<DigiDocServiceConfig>(Configuration.GetSection("DigiDocServiceVariables"));
And then add those sections to the appsettings.json class.
CertificateValidation section has mandatory value - RedirectUrl.
Other values are already set unless you want to override those.
In DigiDocServiceVariables are no mandatory values.In your middleware class constructor add values to the CertificateAuthenticationHelper class variables like this:
public IdAuthMiddleware( RequestDelegate next, IOptions<CertificateValidalidationConfig> certificateValidalidationConfig, IOptions<DigiDocServiceConfig> digiDocServiceVariables ) { _next = next; CertificateValidalidationConfig = certificateValidalidationConfig.Value; DigiDocServiceConfig = digiDocServiceVariables.Value; }
In your middleware class in method Invoke, call out for the CertificateAuthenticationHelper class method InvokeCert. Like this: public async Task Invoke(HttpContext httpContext)
{ await InvokeCert(httpContext); await _next(httpContext); }
To use Mobile-ID functionality
- Make new Controller class
- Let it inherit the MobileIdControllerHelper class
- Register classes MobileIdConfig, MobileIdHelperConfig, and DigiDocServiceConfig in the Startup class, ConfigureService method. For example if you want to use Options patter JSON option it should look something like this:
services.Configure<MobileIdConfig>(Configuration.GetSection("MobileIdConfiguration")); services.Configure<MobileIdHelperConfig>(Configuration.GetSection("MobileIdServiceConstants")); services.Configure<DigiDocServiceConfig>(Configuration.GetSection("DigiDocServiceVariables"));
- And then add those sections to the appsettings.json class.
- In your Controller class constructor add values to the MobileIdControllerHelper class variables like this:
public HomeController(IOptions<MobileIdConfig> mobileIdConfig, IOptions<MobileIdHelperConfig> mobileIdHelperConfig, IOptions<DigiDocServiceConfig> digiDocServiceConfig) { MobileIdConfiguration = mobileIdConfig.Value; MobileIdServiceConstants = mobileIdHelperConfig.Value; DigiDocServiceConfig = digiDocServiceConfig.Value; }
- Call out method InitializeMobileAuthJson to start Mobile-ID Authentication:
public IActionResult Index(string idCode, string phoneNr){ InitializeMobileAuthJson(idCode, phoneNr) return View(); }
- Optinally, write Javascript code to poll method PollMobileAuthStatusJason
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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.1.0-rc1-final)
- Microsoft.AspNetCore.Mvc (>= 2.0.2)
- Microsoft.Extensions.Options (>= 2.1.0-rc1-final)
- Newtonsoft.Json (>= 11.0.2)
- System.ServiceModel.Duplex (>= 4.5.0-rc1-26502-06)
- System.ServiceModel.Http (>= 4.5.0-rc1-26502-06)
- System.ServiceModel.NetTcp (>= 4.5.0-rc1-26502-06)
- System.ServiceModel.Security (>= 4.5.0-rc1-26502-06)
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.1.3 | 971 | 5/23/2018 |