Signaturgruppen.OAuth
3.0.3
dotnet add package Signaturgruppen.OAuth --version 3.0.3
NuGet\Install-Package Signaturgruppen.OAuth -Version 3.0.3
<PackageReference Include="Signaturgruppen.OAuth" Version="3.0.3" />
paket add Signaturgruppen.OAuth --version 3.0.3
#r "nuget: Signaturgruppen.OAuth, 3.0.3"
// 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 | Versions 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. |
-
net8.0
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 8.0.1)
- Microsoft.AspNetCore.Identity.UI (>= 8.0.1)
- System.IdentityModel.Tokens.Jwt (>= 7.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
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