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");