Logout client: no auto-redirect, pin the redirect rule and the 10 s timeout
The named logout HttpClient's primary handler disables auto-redirect, so a 3xx from MAS is a non-delivery retried like any non-2xx instead of being followed to a final 2xx that revokes. Pinned through the real DI registration against a real loopback listener answering 302, and the registered client's Timeout is pinned to exactly 10 s. The unexpected-exception test is replaced by the isolation test (its fix is the next commit) and the cancellation test stands alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
51fe807b66
commit
ec66fba5ca
3 changed files with 199 additions and 9 deletions
|
|
@ -70,7 +70,9 @@ public static class OidcServiceCollectionExtensions
|
|||
services.AddHostedService<OidcClientSeeder>();
|
||||
if (!string.IsNullOrWhiteSpace(options.Clients.Mas.BackchannelLogoutUri))
|
||||
{
|
||||
services.AddHttpClient(OidcLogoutReconciler.HttpClientName, client => client.Timeout = OidcLogoutReconciler.RequestTimeout);
|
||||
// MAS answers the logout POST itself: a redirect is a non-delivery, never followed to some other 2xx.
|
||||
services.AddHttpClient(OidcLogoutReconciler.HttpClientName, client => client.Timeout = OidcLogoutReconciler.RequestTimeout)
|
||||
.ConfigurePrimaryHttpMessageHandler(() => new SocketsHttpHandler { AllowAutoRedirect = false });
|
||||
services.AddHostedService<OidcLogoutReconciler>();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue