From f15725ade28e5683e49c1c7573e0c858ce33954a Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 16 Mar 2026 13:18:24 +0100 Subject: [PATCH] Support NTLM password substitution in DEBUG mode In DEBUG builds, replace "%NTLM_PW%" in NTLM auth password with a value from config. This enables dynamic credential testing without hardcoding passwords. --- .../RecActions/Commands/InvokeRecActionViewCommand.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs index eeac815..d447ecd 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs @@ -95,9 +95,14 @@ public class InvokeRecActionViewCommandHandler( case EndpointAuthType.NtlmAuth: if (!string.IsNullOrWhiteSpace(action.EndpointAuthUsername)) { + var endpointAuthPassword = action.EndpointAuthPassword +#if DEBUG + ?.Replace("%NTLM_PW%", config?.GetValue("%NTLM_PW%")) +#endif + ; var credentials = new NetworkCredential( action.EndpointAuthUsername, - action.EndpointAuthPassword, + endpointAuthPassword, action.EndpointAuthDomain); var credentialCache = new CredentialCache { { httpReq.RequestUri!, "NTLM", credentials } }; httpReq.Options.Set(new HttpRequestOptionsKey("Credentials"), credentialCache);