Signaturgruppen.OAuth 3.0.3

dotnet add package Signaturgruppen.OAuth --version 3.0.3
NuGet\Install-Package Signaturgruppen.OAuth -Version 3.0.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="Signaturgruppen.OAuth" Version="3.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Signaturgruppen.OAuth --version 3.0.3
#r "nuget: Signaturgruppen.OAuth, 3.0.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 Signaturgruppen.OAuth as a Cake Addin
#addin nuget:?package=Signaturgruppen.OAuth&version=3.0.3

// Install Signaturgruppen.OAuth as a Cake Tool
#tool nuget:?package=Signaturgruppen.OAuth&version=3.0.3

Signaturgruppen.Oauth

Library to help developers implement the authentication on their application through Signaturgruppen services suing MitID.

...

var authenticationBuilder = services.AddAuthentication();
authenticationBuilder.AddSignaturgruppen(SignaturgruppenDefaults.AuthenticationScheme, "signaturgruppen", options =>
{
  options.Options = new SignaturgruppenRequestOptions
  {
    Environment = (Configuration["Signaturgruppen:Environment"] == "Test") ? SignaturgruppenEnvironment.Test : SignaturgruppenEnvironment.Prod,
    Amr = new[] { SignaturgruppenAmrValues.MitidOtp, SignaturgruppenAmrValues.NemIdOtp },
    Locale = SignaturgruppenLocales.English
  };

  options.Events.OnRemoteFailure = ctx =>
  {
    var queryParams = ctx.Request.QueryString.ToString();
    if (ctx.Request.Method == "POST")
    {
      queryParams = QueryHelpers.AddQueryString("", ctx.Request.Form?.ToDictionary(p => p.Key, p => p.Value.ToString()));
    }

    ctx.Response.Redirect($"/Account/RemoteFailure{queryParams}");
    ctx.HandleResponse();
    return Task.FromResult(0);
  };

  options.AccessDeniedPath = CookieAuthenticationDefaults.AccessDeniedPath;
  options.ConfigureEnvironment(Configuration["Signaturgruppen:Environment"] == "Test" ? SignaturgruppenEnvironment.Test : SignaturgruppenEnvironment.Prod);
  options.SignInScheme = IdentityConstants.ExternalScheme;
  options.ClientId = Configuration["Signaturgruppen:Key"];
  options.ClientSecret = Configuration["Signaturgruppen:Secret"];
  options.AddScopesWithClaims(SignaturgruppenScopes.Ssn, SignaturgruppenScopes.Nemid, SignaturgruppenScopes.Mitid);
});

...
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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
3.0.3 91 1/21/2024
3.0.0 75 1/19/2024
2.0.0 68 1/19/2024
1.0.5 76 1/19/2024
1.0.4 2,199 8/11/2021
1.0.3 359 7/26/2021
1.0.2 319 4/6/2021
1.0.1 340 4/6/2021
1.0.0 347 4/5/2021

3.0.1, 3.0.2, 3.0.3
     - Update package information and project URL
3.0.0
   - Migrate to .Net 8.0
2.0.0
   - Migrate to .Net 6.0
1.0.5
 - FIX the missing claim mitid.uuid
1.0.4
     - FIX the pre-preoduction token endpoint url
 - Review the claim mappings
 - Get the user-info claims to be able to get CPR as name identifier
1.0.3
     - Review the implementation of the login provider
1.0.2
     - Change options to OIDC options instead OAuth options to handle better the configuration
     - Clean the code
1.0.1
     - Fix authentication URLs
1.0.0
     - Initialization of login provider