From 6707b519c7270d14179f32465ca6514b8da7f35e Mon Sep 17 00:00:00 2001 From: David Kydd Date: Fri, 21 Sep 2018 17:15:09 +1200 Subject: [PATCH] Retain AAD Domain if we have to prompt for new sign in --- azure_batch_maya/scripts/config.py | 4 ++++ azure_batch_maya/scripts/ui/ui_config.py | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/azure_batch_maya/scripts/config.py b/azure_batch_maya/scripts/config.py index 487f6e1..867cc87 100644 --- a/azure_batch_maya/scripts/config.py +++ b/azure_batch_maya/scripts/config.py @@ -270,6 +270,10 @@ class AzureBatchConfig(object): if(not self.mgmt_auth_token or not self.batch_auth_token): self.ui.prompt_for_aad_tenant() + if self.aad_tenant_name and self.aad_tenant_name != None and self.aad_tenant_name != 'None': + maya.text_field(self.ui._aad_tenant_field, edit=True, text=self.aad_tenant_name) + self.ui.aad_tenant_name_changed(self.aad_tenant_name) + maya.refresh() else: if self.need_to_refresh_auth_tokens([self.mgmt_auth_token, self.batch_auth_token]): refreshedTokens = self.refresh_auth_tokens(self.mgmt_auth_token, self.batch_auth_token) diff --git a/azure_batch_maya/scripts/ui/ui_config.py b/azure_batch_maya/scripts/ui/ui_config.py index 62a6f45..ccea30a 100644 --- a/azure_batch_maya/scripts/ui/ui_config.py +++ b/azure_batch_maya/scripts/ui/ui_config.py @@ -71,6 +71,7 @@ class ConfigUI(object): def prompt_for_aad_tenant(self): self.auth_status = "Please input your AAD domain name" + maya.text_field(self._aad_tenant_field, edit=True, text="") maya.form_layout(self.page, edit=True, enable=True) maya.refresh() @@ -514,8 +515,6 @@ class ConfigUI(object): self.base.can_init_from_config = False self.base.auth = False - self.base.session() - #self.frame.is_logged_out() try: self.base.prompt_for_and_obtain_aad_tokens()