From b486b71db7041c1dfcbd02369fb0aec802de02de Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Fri, 23 Sep 2022 10:46:54 -0400 Subject: [PATCH] emit logs on response handling --- src/Duende.Bff/EndpointProcessing/BffAuthenticationService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Duende.Bff/EndpointProcessing/BffAuthenticationService.cs b/src/Duende.Bff/EndpointProcessing/BffAuthenticationService.cs index 2fa36f33..68867c0e 100644 --- a/src/Duende.Bff/EndpointProcessing/BffAuthenticationService.cs +++ b/src/Duende.Bff/EndpointProcessing/BffAuthenticationService.cs @@ -55,6 +55,8 @@ public async Task ChallengeAsync(HttpContext context, string? scheme, Authentica var requireResponseHandling = endpoint.Metadata.GetMetadata() == null; if (requireResponseHandling) { + _logger.LogDebug("Challenge was called for a BFF API endpoint, BFF response handing changing status code to 401."); + context.Response.StatusCode = 401; context.Response.Headers.Remove("Location"); context.Response.Headers.Remove("Set-Cookie"); @@ -79,6 +81,8 @@ public async Task ForbidAsync(HttpContext context, string? scheme, Authenticatio var requireResponseHandling = endpoint.Metadata.GetMetadata() == null; if (requireResponseHandling) { + _logger.LogDebug("Forbid was called for a BFF API endpoint, BFF response handing changing status code to 403."); + context.Response.StatusCode = 403; context.Response.Headers.Remove("Location"); context.Response.Headers.Remove("Set-Cookie");