The Yavsc.Org integration tests were failing 'Internal Server Error' on
the OIDC discovery document when run as part of the full test suite.
Root cause: WebHostFixture bound Kestrel to IPAddress.Loopback on a
dynamically-allocated port and exposed it via IServerAddressesFeature.
But the OIDC issuer URLs (and the issuer claim) come from Site:Authority,
which was left at the production value (mercure.pschneider.fr). So
IdentityServer8's discovery document advertised URLs unreachable from
the test process, and the discovery call returned a 500.
Fix:
- WebServerFixture now overrides Site:Authority and Site:ExternalUrl
in AddInMemoryCollection to 'https://localhost:44300' (the ASP.NET
Core dev HTTPS convention).
- WebHostFixture reads Site:Authority from configuration and binds
Kestrel to that fixed URL. The exposed Addresses list is sourced
from the same configuration value instead of the
IServerAddressesFeature, so the listen URL and the OIDC issuer
URLs always match.
Remoting.cs (Mandatory/Remoting.cs): add 'using
Microsoft.Extensions.DependencyInjection;' so the existing OIDC/DB
diagnostic block (capture raw HTTP response + dump OIDC-related DB
state on discovery failure) compiles. The diagnostic itself is left
in place — it's what surfaced the 500 in the first place.
|
||
|---|---|---|
| .. | ||
| Controllers | ||
| Fakes | ||
| Mandatory | ||
| NonRegression | ||
| Resources | ||
| Smoke | ||
| appsettings.json | ||
| ComputeKidTests.cs | ||
| Directory.Packages.props | ||
| DumpHtml.cs | ||
| EstimateSignatureFileHelperTests.cs | ||
| StaticAssetsPathsTests.cs | ||
| test.runsettings | ||
| TestUserMiddleware.cs | ||
| TestUserStartupFilter.cs | ||
| TestWebApplicationFactory.cs | ||
| WebServerFixture.cs | ||
| xunit.runner.json | ||
| Yavsc.Org.Tests.csproj | ||