From 81d8544f5f31411644dae47fb6acecff24724692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Wed, 10 Mar 2021 18:13:08 +0100 Subject: [PATCH] Added "AzureAD" RDP login support --- server/src/uds/transports/HTML5RDP/html5rdp.py | 9 ++++++++- server/src/uds/transports/RDP/rdp_base.py | 15 +++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/server/src/uds/transports/HTML5RDP/html5rdp.py b/server/src/uds/transports/HTML5RDP/html5rdp.py index fb93bf69..17ccc6f2 100644 --- a/server/src/uds/transports/HTML5RDP/html5rdp.py +++ b/server/src/uds/transports/HTML5RDP/html5rdp.py @@ -189,8 +189,12 @@ class HTML5RDPTransport(transports.Transport): if self.fixedPassword.value != '': password = self.fixedPassword.value + azureAd = False if self.fixedDomain.value != '': - domain = self.fixedDomain.value + if self.fixedDomain.value.lower() == 'azuread': + azureAd = True + else: + domain = self.fixedDomain.value if self.useEmptyCreds.isTrue(): username, password, domain = '', '', '' @@ -203,6 +207,9 @@ class HTML5RDPTransport(transports.Transport): username = username + '@' + domain domain = '' + + username = 'AzureAD\\' + username + # Fix username/password acording to os manager username, password = userService.processUserPassword(username, password) diff --git a/server/src/uds/transports/RDP/rdp_base.py b/server/src/uds/transports/RDP/rdp_base.py index 32904a9c..0541aaa5 100644 --- a/server/src/uds/transports/RDP/rdp_base.py +++ b/server/src/uds/transports/RDP/rdp_base.py @@ -182,8 +182,13 @@ class BaseRDPTransport(transports.Transport): if self.fixedPassword.value: password = self.fixedPassword.value - if self.fixedDomain.value: - domain = self.fixedDomain.value + + azureAd = False + if self.fixedDomain.value != '': + if self.fixedDomain.value.lower() == 'azuread': + azureAd = True + else: + domain = self.fixedDomain.value if self.useEmptyCreds.isTrue(): username, password, domain = '', '', '' @@ -198,8 +203,6 @@ class BaseRDPTransport(transports.Transport): username = domain + '\\' + username domain = '' - # Temporal "fix" to check if we do something on processUserPassword - # Fix username/password acording to os manager username, password = userService.processUserPassword(username, password) @@ -207,6 +210,10 @@ class BaseRDPTransport(transports.Transport): if '\\' in username: domain, username = username.split('\\') + # If AzureAD, include it on username + if azureAd: + username = 'AzureAD\\' + username + return {'protocol': self.protocol, 'username': username, 'password': password, 'domain': domain} def getConnectionInfo(