Response Not Getting Set in Case of 403

In debugging, we noticed that in the case where the API call fails authentication and returns a 403, the response object passed to the Log method is not getting set and is null. This causes the !response.IsErrorResponse() in CreateEntry to evaluate to True and the exception message not to be logged. What’s interesting is that the Response property on the request object is correctly set.

thanks!

Can you please describe more detailed what the configuration you are using, do you use custom authentication or use predefined from ServiceStack, and how do you call auth methods with info about headers and HTTP request. It would be great if you provide stand alone solution we can look into it.

Are you saying that when you try to call an API without proper authentication and get a 403 that the trace logger is correctly populating the response object in the debugger?

Are you saying that when you try to call an API without proper authentication and get a 403 that the trace logger is correctly populating the response object in the debugger?

By default RequestLogsFeature does not log Authenticate and Register requests. These types are added to HideRequestBodyForRequestDtoTypes setting of RequestLogsFeature. And that’s why you can’t get response on wrong authentication or when user is not authenticated.