add secret server handler to RDP and SSH

This commit is contained in:
tecxx
2021-11-04 21:13:37 +01:00
parent 6fbd4a7c88
commit 8c9c4865f2
3 changed files with 35 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ using System.Threading;
using System.Windows.Forms;
using mRemoteNG.Properties;
using mRemoteNG.Resources.Language;
using SecretServerInterface;
// ReSharper disable ArrangeAccessorOwnerBody
@@ -114,6 +115,20 @@ namespace mRemoteNG.Connection.Protocol
}
}
// access secret server api if necessary
if (username.StartsWith("SSAPI:"))
{
var domain = ""; // dummy
try
{
SecretServerInterface.SecretServerInterface.fetchSecretFromServer(username, out username, out password, out domain);
}
catch (Exception ex)
{
Event_ErrorOccured(this, "Secret Server Interface Error: " + ex.Message, 0);
}
}
arguments.Add("-" + (int)PuttySSHVersion);
if (!Force.HasFlag(ConnectionInfo.Force.NoCredentials))

View File

@@ -461,6 +461,20 @@ namespace mRemoteNG.Connection.Protocol.RDP
var password = connectionInfo?.Password ?? "";
var domain = connectionInfo?.Domain ?? "";
// access secret server api if necessary
if (userName.StartsWith("SSAPI:"))
{
try
{
SecretServerInterface.SecretServerInterface.fetchSecretFromServer(userName, out userName, out password, out domain);
}
catch (Exception ex)
{
Event_ErrorOccured(this, "Secret Server Interface Error: " + ex.Message, 0);
}
}
if (string.IsNullOrEmpty(userName))
{
if (Settings.Default.EmptyCredentials == "windows")

View File

@@ -1412,6 +1412,12 @@
<Isolated>False</Isolated>
</COMReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SecretServerInterface\SecretServerInterface.csproj">
<Project>{CBEEE1A0-B917-4F61-812B-85C4C15E80FC}</Project>
<Name>SecretServerInterface</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>:: When passing paths to powershell scripts, check if the path ends with a backslash "\"
:: If it does, then the backslash may be interpreted as an escape character. Add another backslash to cancel the first one.