mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
add secret server handler to RDP and SSH
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user