Forum / Remote Desktop Manager - SDK

Retrieving credentials for Session Tool Addon

  • Create an Issue
  • Cancel

Is there a way I can get the credentials for an RDP connection in a session tool addon?

I can get the password with session.GetProperty("RDP", "SafePassword") however this is encrypted, is there a way I can decrypt this?

Clock6 yrs

session.GetPassword() should do the trick. Password, UserName & domain are special, you can't access them with GetProperty(...)

Stefane Lavergne

signaturesignature

Clock6 yrs

There doesn't seem to be a GetPassword for ISession?

There is SetPassword, but not Get.

Clock6 yrs

They were introduced in ISessionAddOn4. Try casting it as such

Stefane Lavergne

signaturesignature

Clock6 yrs

That would work for a session addon but I am trying to create a session tool addon using BaseSessionToolAddon2.

Clock6 yrs

I will have to double check with David

Stefane Lavergne

signaturesignature

Clock6 yrs

After discussion with David, we have a solution but it will need to be implement.

Since sending the credentials to a tools addon might be a security risk we will added an "Allow tools addon" check box on session's "Tools" tab, something like this:

6+2+2014+8+16+20+AM


We will then define the ISession3 interface that will introduce a method called "GetToolsCredentials", this will return the username/password/domain of the session.

ETA end of the week.

Regards,

Stefane Lavergne

signaturesignature

6-2-2014 8-16-20 AM.png
Clock6 yrs

Sounds good to me, thanks for your help and the quick response.

Clock6 yrs

The code is done, it will be in the next beta build.

new interface (version 3), you can cast any ISession to ISession3

    public interface ISession3 : ISession2
{
SessionToolsCredential GetSessionToolsCredential();
}


The result looks like this
    public class SessionToolsCredential
{
public string UserName { get; set; }

public string Password { get; set; }

public string Domain { get; set; }
}

What we are actually returning here are the resolved tools credentials. (see here for more info)

Note: the result can/will be null. If the "Allow addon" isn't checked for example or if the session is set to use the default tools credentials.

Example, use the same credentials as the session, with "allow addon"
6+3+2014+2+47+59+PM

Regards,

Stefane Lavergne

signaturesignature

6-3-2014 2-47-59 PM.png
Clock6 yrs

The build is ready download from here:

http://remotedesktopmanager.com/Home/Download#beta

Regards,

Stefane Lavergne

signaturesignature

Clock6 yrs

Thanks, I will try it out and let you know if I have any issues.

Clock6 yrs

I have tested this out and it seems to be working, thanks again.

I have ran into another issue when turning on SupportMultiSelect, the controls I return do not show up in embedded tabs.

Here is the code:

public override bool SupportMultiSelect
{
get
{
return true;
}
}

public override ToolExecuteResult Execute(ISession session)
{
// Do some other stuff here with the session

// Create a control and return it.
DeploymentControl c = new DeploymentControl();


return new ToolExecuteResult(c);
}

public override ToolExecuteResult[] Execute(ISession[] sessions)
{
List<ToolExecuteResult> results = new List<ToolExecuteResult>();
foreach (ISession session in sessions)
{
results.Add(Execute(session));
}
return results.ToArray();
}


If I set it back to false then it works without issue, I have checked and it definitely is returning an array with ToolExecuteResults in it.

I am doing something wrong here?

Clock6 yrs

I will ask André to test it on Monday. It's not working today

David Hervieux

signaturesignature

Clock6 yrs

Hi,
I have checked and it seem to work only for non-visual result. I will work on that.

David Hervieux

signaturesignature

Clock6 yrs

This is now fixed in the latest beta 9.4.6.0

David Hervieux

signaturesignature

Clock6 yrs

I have tested the beta and it is working, thanks for your help.

Clock6 yrs