[2515] dotnet10 migration - #2
Open
strongmindsaln wants to merge 24 commits into
Open
Conversation
AesGcm-fix
- Convert all project files (dk.nita.saml20, dk.nita.test.saml20, ext.audit.log4net, ext.sessionstore.sqlserver) to SDK-style targeting net10.0 - Update IntegrationTest project to net10.0 with updated package versions - Remove WebsiteDemo and IdentityProviderDemo from solution (Web Forms incompatible with .NET 10) - Replace System.Web with Microsoft.AspNetCore.Http throughout all source files - Replace System.Web.Caching with SamlMemoryCache helper (IMemoryCache-based) - Replace HttpContext.Current with SamlHttpContextAccessor (IHttpContextAccessor-based) - Replace System.IdentityModel.Selectors X509CertificateValidator with X509Chain - Replace System.Web.Security.FormsAuthentication with no-ops (auth handled by host app) - Replace System.Web.UI.Page in HttpPostBindingBuilder with direct HTML response writing - Replace System.Data.SqlClient with Microsoft.Data.SqlClient - Replace HttpUtility with System.Net.WebUtility throughout - Rewrite BasePage, ErrorPage, SelectSaml20IDP as non-WebForms classes - Rewrite SessionStore to use ASP.NET Core cookies (CookieOptions) - Replace Response.End() calls (not available in ASP.NET Core) - Remove IHttpHandler/IRequiresSessionState from AbstractEndpointHandler - Add SamlHttpContextAccessor, SamlMemoryCache, HttpContextExtensions utility classes - Update NUnit from 2.6.4 to 3.14.0 in test project - Update assembly references in test app.config to kitos.dk.nita.saml20 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…hrows<>() - ArtifactTest.cs: wrap CreateError1/2 and ParseError1/2/3 with Assert.Throws<ArgumentException> - SignatureTest.cs: wrap DeserializeToken calls with Assert.Throws<Saml20Exception>, wrap Saml20Assertion constructor in TestSigning_04 with Assert.Throws<InvalidOperationException> - XmlSignatureUtilsTest.cs: wrap DetectSignature_02 and CheckSignature_01 with Assert.Throws<InvalidOperationException> - DKSAML20ProfileValidationTest.cs: wrap assertion.Validate() calls with Assert.Throws<DKSaml20FormatException> - EncryptedAssertionTest.cs: wrap SessionKeyAlgorithm assignment in Assert.Throws<ArgumentException> - Saml20CoreValidationTest.cs: wrap 65 invalid-input test methods with Assert.Throws<Saml20FormatException> - GlobalTestSetup.cs: add assembly-level SetUpFixture to load FederationConfig/SAML20FederationConfig from the dll.config file, working around ConfigurationManager limitations in .NET 10 - app.config: remove deprecated system.web section and old .NET 4.7.2 startup element - Saml20EncryptedAssertion.cs: fix Decrypt() to use standard EncryptedXml for non-GCM algorithms Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ssertion - Replace RSACryptoServiceProvider casts with RSA base class in all SignatureProvider subclasses; use RSA.SignData/VerifyData with HashAlgorithmName instead of provider-specific APIs - Remove Windows-only ConvertProviderType (CspKeyContainerInfo not available in .NET 10) - Fix Saml20EncryptedAssertion.Decrypt() to fall back to EncryptedXml.DecryptData() for non-AES-GCM algorithms (AES-CBC, 3DES used in existing test assertions) - Fix null-ref in ToSymmetricKey when EncryptedKey.EncryptionMethod is absent Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Triggers on v* tags. Requires NUGET_API_KEY repository secret. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes cross-site POST-back session loss (SameSite cookie issue): - Embed session ID in RelayState on AuthnRequest (BuildRelayState) - Recover session from RelayState on POST-back (TryRecoverSessionFromRelayState) - Pin HttpContext via AsyncLocal in Saml20AbstractEndpointHandler so IHttpContextAccessor is reliable during the SSO callback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The browser blocks the saml-session cookie on a cross-site POST (IdP post-back) due to SameSite restrictions, so the cookie is absent when the browser follows the 302 redirect to GET /SSO. Fix: - SessionStore.RefreshSessionCookie(): re-writes the existing session cookie into the current response. Called from DoLogin() after the SAML assertion is stored so the 302 POST-response carries a fresh Set-Cookie header. The browser then sends this cookie on the subsequent same-site GET /SSO request. Also fix: - Saml20AbstractEndpointHandler.ProcessRequest: guard against calling Handle() when CheckConfiguration() already rendered an error page (validated==false) — prevents WriteSessionCookie() being invoked after the response has started. Bump version to 1.1.8. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.