Skip to content

Conversation

@thecristidima
Copy link

@thecristidima thecristidima commented Aug 29, 2025

This is work-in-progress, it depends on the upgrade to FreeRDP 3 (we can consider it part 3) - see this PR first #44.

Added smart card support from FreeRDP. Changes required to create a session:

  • Enable a few settings
  • Load audio channel - not clear why it's required, but freerdp_connect will return TRUE but the session won't be created unless it's loaded
  • Set instance->ChooseSmartcard for cases where a user has multiple certificates; Robot.Session already finds the smart card certificate to validate the logon credentials, so we'll just have to pass the container name to the wrapper.
  • Import a few more external libs

Known issues:

  • Kerberos is used for smart card authentication and Local System can't use it, so we need to run the wrapper under a normal user; as discussed, we'll run the wrapper out-of-process to work around this limitation
  • FreeRDP can't authenticate if the smart card has multiple certificates enrolled on it; since we can create multiple virtual smart cards, we can just enroll each certificate on a different one

{
context->settings->SmartcardLogon = TRUE;
context->settings->PasswordIsSmartcardPin = TRUE;
context->settings->RedirectSmartCards = TRUE;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed when it is localhost?

DWORD* choice, BOOL gateway) -> BOOL
{
auto res = false;
auto containerName = ConvToUtf16(instance->context->settings->ContainerName);
Copy link
Collaborator

@mihainradu mihainradu Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just note, rdpOptions->smartcardSettings.ContainerName is already utf16
also I would make this callback a decalared/named method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants