EstonianAuthenticationProvider 1.1.3

dotnet add package EstonianAuthenticationProvider --version 1.1.3
NuGet\Install-Package EstonianAuthenticationProvider -Version 1.1.3
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="EstonianAuthenticationProvider" Version="1.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EstonianAuthenticationProvider --version 1.1.3
#r "nuget: EstonianAuthenticationProvider, 1.1.3"
#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 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

  1. 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

  2. Make new project (can be inside the same solution) so that it can be configured to ask for client certificate;

  3. Make new Middleware class in that project and let it inherit the package CertificateAuthenticationHelper class;

  4. Add your Middleware class into the pipleline by registering it in the Startup class, Configure method;

  5. 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.

  6. 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;
    }
    
  7. 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

  1. Make new Controller class
  2. Let it inherit the MobileIdControllerHelper class
  3. 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"));
    
  4. And then add those sections to the appsettings.json class.
  5. 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;
    }
    
  6. Call out method InitializeMobileAuthJson to start Mobile-ID Authentication:
    public IActionResult Index(string idCode, string phoneNr){
        InitializeMobileAuthJson(idCode, phoneNr)
        return View();
    }
    
  7. Optinally, write Javascript code to poll method PollMobileAuthStatusJason
Product 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. 
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
1.1.3 971 5/23/2018