Retrieving credentials for Session Tool Addon

Retrieving credentials for Session Tool Addon

avatar

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?

All Comments (15)

avatar

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

Stéfane Lavergne

avatar

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

There is SetPassword, but not Get.

avatar

They were introduced in ISessionAddOn4. Try casting it as such

Stéfane Lavergne

avatar

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

avatar

I will have to double check with David

Stéfane Lavergne

avatar

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:




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,

Stéfane Lavergne

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

avatar

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

avatar

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"


Regards,

Stéfane Lavergne

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

avatar

The build is ready download from here:

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

Regards,

Stéfane Lavergne

avatar

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

avatar

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:
























































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?

avatar

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

David Hervieux

avatar

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

David Hervieux

avatar

This is now fixed in the latest beta 9.4.6.0

David Hervieux

avatar

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