diff --git a/Passingwind.CommonLibs.sln b/Passingwind.CommonLibs.sln index 3e707dc..2096db6 100644 --- a/Passingwind.CommonLibs.sln +++ b/Passingwind.CommonLibs.sln @@ -13,10 +13,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{31171FC1-4 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.SwaggerExtensions", "src\Passingwind.SwaggerExtensions\Passingwind.SwaggerExtensions.csproj", "{300C8EF1-B040-4F50-BA65-175EE5A82A0F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.AspNetCore.Authentication.Saml2", "src\Passingwind.AspNetCore.Authentication.Saml2\Passingwind.AspNetCore.Authentication.Saml2.csproj", "{4ED083F0-7B73-4380-A4F5-164474FDCF82}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.AspNetCore.Authentication.ApiKey", "src\Authentication.ApiKey\source\Passingwind.AspNetCore.Authentication.ApiKey.csproj", "{F7FE0AD3-B69F-4F10-8EA4-E581EBE4A2AC}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.AspNetCore.Authentication.Saml2", "src\Authentication.Saml2\source\Passingwind.AspNetCore.Authentication.Saml2.csproj", "{6C1D2746-FE37-4AD4-9E40-DF28536472B1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -31,14 +31,14 @@ Global {300C8EF1-B040-4F50-BA65-175EE5A82A0F}.Debug|Any CPU.Build.0 = Debug|Any CPU {300C8EF1-B040-4F50-BA65-175EE5A82A0F}.Release|Any CPU.ActiveCfg = Release|Any CPU {300C8EF1-B040-4F50-BA65-175EE5A82A0F}.Release|Any CPU.Build.0 = Release|Any CPU - {4ED083F0-7B73-4380-A4F5-164474FDCF82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4ED083F0-7B73-4380-A4F5-164474FDCF82}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4ED083F0-7B73-4380-A4F5-164474FDCF82}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4ED083F0-7B73-4380-A4F5-164474FDCF82}.Release|Any CPU.Build.0 = Release|Any CPU {F7FE0AD3-B69F-4F10-8EA4-E581EBE4A2AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F7FE0AD3-B69F-4F10-8EA4-E581EBE4A2AC}.Debug|Any CPU.Build.0 = Debug|Any CPU {F7FE0AD3-B69F-4F10-8EA4-E581EBE4A2AC}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7FE0AD3-B69F-4F10-8EA4-E581EBE4A2AC}.Release|Any CPU.Build.0 = Release|Any CPU + {6C1D2746-FE37-4AD4-9E40-DF28536472B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C1D2746-FE37-4AD4-9E40-DF28536472B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C1D2746-FE37-4AD4-9E40-DF28536472B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6C1D2746-FE37-4AD4-9E40-DF28536472B1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -46,8 +46,8 @@ Global GlobalSection(NestedProjects) = preSolution {41CC2AD6-8FDC-4F00-8CF1-94C89666137E} = {D7A92342-2C8A-4121-8824-95AEF5856AAF} {300C8EF1-B040-4F50-BA65-175EE5A82A0F} = {CE8B3FAE-E7B7-4EB6-BEB5-716F2B91A315} - {4ED083F0-7B73-4380-A4F5-164474FDCF82} = {CE8B3FAE-E7B7-4EB6-BEB5-716F2B91A315} {F7FE0AD3-B69F-4F10-8EA4-E581EBE4A2AC} = {CE8B3FAE-E7B7-4EB6-BEB5-716F2B91A315} + {6C1D2746-FE37-4AD4-9E40-DF28536472B1} = {CE8B3FAE-E7B7-4EB6-BEB5-716F2B91A315} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AB481C2D-55C1-486C-873D-408B11F77F30} diff --git a/src/Authentication.ApiKey/README.md b/src/Authentication.ApiKey/README.md index 5898e74..1f6aeec 100644 --- a/src/Authentication.ApiKey/README.md +++ b/src/Authentication.ApiKey/README.md @@ -2,6 +2,8 @@ ASP.NET Core authentication handler for the ApiKey protocol +[![NuGet](https://img.shields.io/nuget/v/Passingwind.AspNetCore.Authentication.ApiKey?style=flat-square)](https://www.nuget.org/packages/Passingwind.AspNetCore.Authentication.ApiKey) + ## Quickstart ``` cs diff --git a/src/Authentication.Saml2/README.md b/src/Authentication.Saml2/README.md new file mode 100644 index 0000000..305dd1b --- /dev/null +++ b/src/Authentication.Saml2/README.md @@ -0,0 +1,5 @@ +# AspNetCore.Authentication.Saml2 + +ASP.NET Core authentication handler for the SAML2 protocol + +[![NuGet](https://img.shields.io/nuget/v/Passingwind.AspNetCore.Authentication.Saml2?style=flat-square)](https://www.nuget.org/packages/Passingwind.AspNetCore.Authentication.Saml2) \ No newline at end of file diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Configuration/ConfigurationManager.cs b/src/Authentication.Saml2/source/Configuration/ConfigurationManager.cs similarity index 88% rename from src/Passingwind.AspNetCore.Authentication.Saml2/Configuration/ConfigurationManager.cs rename to src/Authentication.Saml2/source/Configuration/ConfigurationManager.cs index 31dd350..5f8c93e 100644 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Configuration/ConfigurationManager.cs +++ b/src/Authentication.Saml2/source/Configuration/ConfigurationManager.cs @@ -6,8 +6,11 @@ using ITfoxtec.Identity.Saml2; using ITfoxtec.Identity.Saml2.Schemas.Metadata; -namespace Passingwind.Authentication.Saml2.Configuration; +namespace Passingwind.AspNetCore.Authentication.Saml2.Configuration; +/// +/// +/// public class ConfigurationManager : IConfigurationManager { private Saml2Configuration? _saml2Configuration; @@ -16,6 +19,12 @@ public class ConfigurationManager : IConfigurationManager private readonly Uri _idpMetadataUri; private readonly HttpClient _httpClient; + /// + /// + /// + /// + /// + /// public ConfigurationManager(Saml2Options options, Uri idpMetadataUrl, HttpClient httpClient) { _options = options; @@ -23,6 +32,11 @@ public ConfigurationManager(Saml2Options options, Uri idpMetadataUrl, HttpClient _httpClient = httpClient; } + /// + /// + /// + /// + /// public async Task GetConfigurationAsync(CancellationToken cancellationToken = default) { if (_saml2Configuration != null) @@ -51,7 +65,7 @@ public async Task GetConfigurationAsync(CancellationToken ca var metadataGetResponse = await _httpClient.GetAsync(_idpMetadataUri, cancellationToken); metadataGetResponse.EnsureSuccessStatusCode(); - var metadataString = await metadataGetResponse.Content.ReadAsStringAsync(); + var metadataString = await metadataGetResponse.Content.ReadAsStringAsync(cancellationToken); entityDescriptor.ReadIdPSsoDescriptor(metadataString); } diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Configuration/IConfigurationManager.cs b/src/Authentication.Saml2/source/Configuration/IConfigurationManager.cs similarity index 50% rename from src/Passingwind.AspNetCore.Authentication.Saml2/Configuration/IConfigurationManager.cs rename to src/Authentication.Saml2/source/Configuration/IConfigurationManager.cs index 8524e8f..688abf2 100644 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Configuration/IConfigurationManager.cs +++ b/src/Authentication.Saml2/source/Configuration/IConfigurationManager.cs @@ -2,9 +2,17 @@ using System.Threading.Tasks; using ITfoxtec.Identity.Saml2; -namespace Passingwind.Authentication.Saml2.Configuration; +namespace Passingwind.AspNetCore.Authentication.Saml2.Configuration; +/// +/// +/// public interface IConfigurationManager { + /// + /// + /// + /// + /// Task GetConfigurationAsync(CancellationToken cancellationToken = default); } diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Configuration/StaticConfigurationManager.cs b/src/Authentication.Saml2/source/Configuration/StaticConfigurationManager.cs similarity index 62% rename from src/Passingwind.AspNetCore.Authentication.Saml2/Configuration/StaticConfigurationManager.cs rename to src/Authentication.Saml2/source/Configuration/StaticConfigurationManager.cs index d2181e7..4bbb079 100644 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Configuration/StaticConfigurationManager.cs +++ b/src/Authentication.Saml2/source/Configuration/StaticConfigurationManager.cs @@ -2,17 +2,29 @@ using System.Threading.Tasks; using ITfoxtec.Identity.Saml2; -namespace Passingwind.Authentication.Saml2.Configuration; +namespace Passingwind.AspNetCore.Authentication.Saml2.Configuration; +/// +/// +/// public class StaticConfigurationManager : IConfigurationManager { private readonly Saml2Configuration _saml2Configuration; + /// + /// + /// + /// public StaticConfigurationManager(Saml2Configuration saml2Configuration) { _saml2Configuration = saml2Configuration; } + /// + /// + /// + /// + /// public Task GetConfigurationAsync(CancellationToken cancellationToken = default) { return Task.FromResult(_saml2Configuration); diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Extensions.cs b/src/Authentication.Saml2/source/Extensions.cs similarity index 93% rename from src/Passingwind.AspNetCore.Authentication.Saml2/Extensions.cs rename to src/Authentication.Saml2/source/Extensions.cs index 2f747d0..699a3c1 100644 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Extensions.cs +++ b/src/Authentication.Saml2/source/Extensions.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; -namespace Passingwind.Authentication.Saml2; +namespace Passingwind.AspNetCore.Authentication.Saml2; -static class Extensions +internal static class Extensions { public static ITfoxtec.Identity.Saml2.Http.HttpRequest ToGenericHttpRequest(this HttpRequest request, bool readBodyAsString = false) { diff --git a/src/Authentication.Saml2/source/Passingwind.AspNetCore.Authentication.Saml2.csproj b/src/Authentication.Saml2/source/Passingwind.AspNetCore.Authentication.Saml2.csproj new file mode 100644 index 0000000..e45b8a3 --- /dev/null +++ b/src/Authentication.Saml2/source/Passingwind.AspNetCore.Authentication.Saml2.csproj @@ -0,0 +1,51 @@ + + + + net6;net7 + enable + Passingwind.AspNetCore.Authentication.Saml2 + latest-minimum + True + $(AssemblyVersion) + 0.1 + + + + Passingwind.AspNetCore.Authentication.Saml2 + Passingwind.AspNetCore.Authentication.Saml2 + Passingwind + https://github.com/jxnkwlp/Passingwind.CommonLibs + https://github.com/jxnkwlp/Passingwind.CommonLibs + git + authentication, SAML2 + ASP.NET Core authentication handler for the SAML2 protocol + README.md + MIT + True + snupkg + 0.1.0 + + + + + + + + + + + + + True + \ + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + diff --git a/src/Authentication.Saml2/source/Saml2Defaults.cs b/src/Authentication.Saml2/source/Saml2Defaults.cs new file mode 100644 index 0000000..7d2667b --- /dev/null +++ b/src/Authentication.Saml2/source/Saml2Defaults.cs @@ -0,0 +1,17 @@ +namespace Passingwind.AspNetCore.Authentication.Saml2; + +/// +/// +/// +public static class Saml2Defaults +{ + /// + /// + /// + public const string AuthenticationScheme = "Saml2"; + + /// + /// + /// + public const string DisplayName = "Saml2"; +} diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Events.cs b/src/Authentication.Saml2/source/Saml2Events.cs similarity index 76% rename from src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Events.cs rename to src/Authentication.Saml2/source/Saml2Events.cs index d3dc730..7e4cbaa 100644 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Events.cs +++ b/src/Authentication.Saml2/source/Saml2Events.cs @@ -5,8 +5,11 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; -namespace Passingwind.Authentication.Saml2; +namespace Passingwind.AspNetCore.Authentication.Saml2; +/// +/// +/// public class Saml2Events : RemoteAuthenticationEvents { /// @@ -76,14 +79,30 @@ public class Saml2Events : RemoteAuthenticationEvents public virtual Task SecurityTokenValidated(SecurityTokenValidatedContext context) => OnSecurityTokenValidated(context); } +/// +/// +/// public class RedirectContext : PropertiesContext { + /// + /// + /// + /// + /// + /// + /// public RedirectContext(HttpContext context, AuthenticationScheme scheme, Saml2Options options, AuthenticationProperties? properties) : base(context, scheme, options, properties) { } + /// + /// + /// public Saml2AuthnRequest Saml2AuthnRequest { get; set; } = default!; + /// + /// + /// public Saml2RedirectBinding RedirectBinding { get; set; } = default!; /// @@ -97,50 +116,118 @@ public RedirectContext(HttpContext context, AuthenticationScheme scheme, Saml2Op public void HandleResponse() => Handled = true; } +/// +/// +/// public class RemoteSignOutContext : RemoteAuthenticationContext { + /// + /// + /// + /// + /// + /// + /// public RemoteSignOutContext(HttpContext context, AuthenticationScheme scheme, Saml2Options options, AuthenticationProperties? properties) : base(context, scheme, options, properties) { } + /// + /// + /// public Saml2AuthnResponse Saml2AuthnResponse { get; set; } = default!; } +/// +/// +/// public class MessageReceivedContext : RemoteAuthenticationContext { + /// + /// + /// + /// + /// + /// + /// public MessageReceivedContext(HttpContext context, AuthenticationScheme scheme, Saml2Options options, AuthenticationProperties? properties) : base(context, scheme, options, properties) { } + /// + /// + /// public Saml2AuthnResponse Saml2AuthnResponse { get; set; } = default!; } +/// +/// +/// public class SecurityTokenReceivedContext : RemoteAuthenticationContext { + /// + /// + /// + /// + /// + /// + /// public SecurityTokenReceivedContext(HttpContext context, AuthenticationScheme scheme, Saml2Options options, AuthenticationProperties? properties) : base(context, scheme, options, properties) { } + /// + /// + /// public Saml2AuthnResponse Saml2AuthnResponse { get; set; } = default!; } +/// +/// +/// public class SecurityTokenValidatedContext : RemoteAuthenticationContext { + /// + /// + /// + /// + /// + /// + /// + /// public SecurityTokenValidatedContext(HttpContext context, AuthenticationScheme scheme, Saml2Options options, ClaimsPrincipal principal, AuthenticationProperties? properties) : base(context, scheme, options, properties) { Principal = principal; } + /// + /// + /// public Saml2AuthnResponse Saml2AuthnResponse { get; set; } = default!; } +/// +/// +/// public class AuthenticationFailedContext : RemoteAuthenticationContext { + /// + /// + /// + /// + /// + /// public AuthenticationFailedContext(HttpContext context, AuthenticationScheme scheme, Saml2Options options) : base(context, scheme, options, null) { } + /// + /// + /// public Saml2AuthnResponse Saml2AuthnResponse { get; set; } = default!; + /// + /// + /// public Exception Exception { get; set; } = default!; } diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Extensions.cs b/src/Authentication.Saml2/source/Saml2Extensions.cs similarity index 59% rename from src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Extensions.cs rename to src/Authentication.Saml2/source/Saml2Extensions.cs index 75b0c6e..2aad021 100644 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Extensions.cs +++ b/src/Authentication.Saml2/source/Saml2Extensions.cs @@ -4,15 +4,32 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; -namespace Passingwind.Authentication.Saml2; +namespace Passingwind.AspNetCore.Authentication.Saml2; +/// +/// +/// public static class Saml2Extensions { + /// + /// + /// + /// + /// + /// public static AuthenticationBuilder AddSaml2(this AuthenticationBuilder builder, Action? configureOptions = null) { - return AddSaml2(builder, Saml2Defaults.AuthenticationScheme, Saml2Defaults.AuthenticationScheme, configureOptions); + return builder.AddSaml2(Saml2Defaults.AuthenticationScheme, Saml2Defaults.AuthenticationScheme, configureOptions); } + /// + /// + /// + /// + /// + /// + /// + /// public static AuthenticationBuilder AddSaml2(this AuthenticationBuilder builder, string scheme, string? displayName = null, Action? configureOptions = null) { builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton, Saml2PostConfigureOptions>()); diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Handler.cs b/src/Authentication.Saml2/source/Saml2Handler.cs similarity index 87% rename from src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Handler.cs rename to src/Authentication.Saml2/source/Saml2Handler.cs index 897b8c8..e5b6dd4 100644 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Handler.cs +++ b/src/Authentication.Saml2/source/Saml2Handler.cs @@ -10,24 +10,42 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Passingwind.Authentication.Saml2; +namespace Passingwind.AspNetCore.Authentication.Saml2; +/// +/// +/// public class Saml2Handler : RemoteAuthenticationHandler, IAuthenticationSignOutHandler { private Saml2Configuration? _configuration; private const string RelayStateName = "State"; private const string CorrelationProperty = ".xsrf"; + /// + /// + /// protected new Saml2Events Events { get { return (Saml2Events)base.Events; } set { base.Events = value; } } + /// + /// + /// + /// + /// + /// + /// public Saml2Handler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) { } + /// + /// + /// + /// + /// protected override async Task HandleChallengeAsync(AuthenticationProperties properties) { properties ??= new AuthenticationProperties(); @@ -43,13 +61,15 @@ protected override async Task HandleChallengeAsync(AuthenticationProperties prop properties.RedirectUri = OriginalPathBase + OriginalPath + Request.QueryString; } - var saml2AuthnRequest = new Saml2AuthnRequest(_configuration); - saml2AuthnRequest.ForceAuthn = Options.ForceAuthn; - saml2AuthnRequest.NameIdPolicy = Options.NameIdPolicy; - saml2AuthnRequest.RequestedAuthnContext = new RequestedAuthnContext + var saml2AuthnRequest = new Saml2AuthnRequest(_configuration) { - Comparison = AuthnContextComparisonTypes.Exact, - AuthnContextClassRef = new string[] { AuthnContextClassTypes.PasswordProtectedTransport.OriginalString }, + ForceAuthn = Options.ForceAuthn, + NameIdPolicy = Options.NameIdPolicy, + RequestedAuthnContext = new RequestedAuthnContext + { + Comparison = AuthnContextComparisonTypes.Exact, + AuthnContextClassRef = new string[] { AuthnContextClassTypes.PasswordProtectedTransport.OriginalString }, + } }; var relayStateQuery = new Dictionary(); @@ -84,11 +104,20 @@ protected override async Task HandleChallengeAsync(AuthenticationProperties prop Response.Redirect(binding.RedirectLocation.OriginalString); } + /// + /// + /// + /// + /// public Task SignOutAsync(AuthenticationProperties? properties) { return Task.CompletedTask; } + /// + /// + /// + /// protected override async Task HandleRemoteAuthenticateAsync() { if (_configuration == null) diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Options.cs b/src/Authentication.Saml2/source/Saml2Options.cs similarity index 74% rename from src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Options.cs rename to src/Authentication.Saml2/source/Saml2Options.cs index 20e7127..b3605f0 100644 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Options.cs +++ b/src/Authentication.Saml2/source/Saml2Options.cs @@ -7,45 +7,93 @@ using ITfoxtec.Identity.Saml2.Schemas; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; -using Passingwind.Authentication.Saml2.Configuration; +using Passingwind.AspNetCore.Authentication.Saml2.Configuration; -namespace Passingwind.Authentication.Saml2; +namespace Passingwind.AspNetCore.Authentication.Saml2; +/// +/// +/// public class Saml2Options : RemoteAuthenticationOptions { + /// + /// + /// public string Issuer { get; set; } = null!; + /// + /// + /// public NameIdPolicy? NameIdPolicy { get; set; } + /// + /// + /// public string SignOutScheme { get; set; } = null!; + /// + /// + /// public PathString RemoteSignOutPath { get; set; } + /// + /// + /// public bool ForceAuthn { get; set; } + /// + /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public new bool SaveTokens { get; set; } + /// + /// + /// public new Saml2Events Events { get => (Saml2Events)base.Events; set => base.Events = value; } + /// + /// + /// public Uri? IdpMetadataUri { get; set; } + /// + /// + /// public X509Certificate2? SigningCertificate { get; set; } + /// + /// + /// public List? SignatureValidationCertificates { get; set; } + /// + /// + /// public X509CertificateValidationMode CertificateValidationMode { get; set; } + /// + /// + /// public Saml2Configuration Configuration { get; set; } = null!; + /// + /// + /// public IConfigurationManager ConfigurationManager { get; set; } = default!; + /// + /// + /// public ISecureDataFormat StateDataFormat { get; set; } = default!; + /// + /// + /// public Saml2Options() { Events = new Saml2Events(); @@ -69,6 +117,9 @@ public Saml2Options() //}; } + /// + /// + /// public override void Validate() { base.Validate(); diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2PostConfigureOptions.cs b/src/Authentication.Saml2/source/Saml2PostConfigureOptions.cs similarity index 84% rename from src/Passingwind.AspNetCore.Authentication.Saml2/Saml2PostConfigureOptions.cs rename to src/Authentication.Saml2/source/Saml2PostConfigureOptions.cs index df28f93..bb5f4da 100644 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2PostConfigureOptions.cs +++ b/src/Authentication.Saml2/source/Saml2PostConfigureOptions.cs @@ -1,21 +1,33 @@ -using System; +using System; using System.Net.Http; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.DataProtection; using Microsoft.Extensions.Options; -using Passingwind.Authentication.Saml2.Configuration; +using Passingwind.AspNetCore.Authentication.Saml2.Configuration; -namespace Passingwind.Authentication.Saml2; +namespace Passingwind.AspNetCore.Authentication.Saml2; +/// +/// +/// public class Saml2PostConfigureOptions : IPostConfigureOptions { private readonly IDataProtectionProvider _dp; + /// + /// + /// + /// public Saml2PostConfigureOptions(IDataProtectionProvider dp) { _dp = dp; } + /// + /// + /// + /// + /// public void PostConfigure(string name, Saml2Options options) { if (string.IsNullOrEmpty(name)) diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Passingwind.AspNetCore.Authentication.Saml2.csproj b/src/Passingwind.AspNetCore.Authentication.Saml2/Passingwind.AspNetCore.Authentication.Saml2.csproj deleted file mode 100644 index 2f3dcc1..0000000 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Passingwind.AspNetCore.Authentication.Saml2.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - net6;net7 - enable - Passingwind.Authentication.Saml2 - Passingwind.Authentication.Saml2 - Passingwind - https://github.com/jxnkwlp/Passingwind.CommonLibs - https://github.com/jxnkwlp/Passingwind.CommonLibs - github - SAML2, authentication - ASP.NET Core authentication handler for the SAML2 protocol - 0.1.0 - - - - - - - - diff --git a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Defaults.cs b/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Defaults.cs deleted file mode 100644 index 3d802a0..0000000 --- a/src/Passingwind.AspNetCore.Authentication.Saml2/Saml2Defaults.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Passingwind.Authentication.Saml2; - -public static class Saml2Defaults -{ - public const string AuthenticationScheme = "Saml2"; - - public const string DisplayName = "Saml2"; -}