From 03b78dd57b32fbdf13a61ccc2d537127c1d96a62 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Fri, 28 Jul 2023 15:56:35 +0200 Subject: [PATCH] [aad] print http status response message --- client/common/client.c | 8 ++++++-- libfreerdp/core/aad.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/common/client.c b/client/common/client.c index 8b46dc983..a15356aad 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -1143,8 +1143,12 @@ BOOL client_common_get_access_token(freerdp* instance, const char* request, char if (resp_code != HTTP_STATUS_OK) { char buffer[64] = { 0 }; - WLog_ERR(TAG, "Server unwilling to provide access token; returned status code %s", - freerdp_http_status_string_format(resp_code, buffer, sizeof(buffer))); + wLog* log = WLog_Get(TAG); + WLog_Print(log, WLOG_ERROR, + "Server unwilling to provide access token; returned status code %s", + freerdp_http_status_string_format(resp_code, buffer, sizeof(buffer))); + if (response_length > 0) + WLog_Print(log, WLOG_ERROR, "[status message] %s", response); goto cleanup; } diff --git a/libfreerdp/core/aad.c b/libfreerdp/core/aad.c index 331f15bf6..203a62313 100644 --- a/libfreerdp/core/aad.c +++ b/libfreerdp/core/aad.c @@ -246,6 +246,8 @@ static BOOL aad_get_nonce(rdpAad* aad) { WLog_Print(aad->log, WLOG_ERROR, "Server unwilling to provide nonce; returned status code %li", resp_code); + if (response_length > 0) + WLog_Print(aad->log, WLOG_ERROR, "[status message] %s", response); goto fail; }