diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-01-19 00:30:23 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-01-19 00:30:23 +0200 |
| commit | b9c104e259ca24d2ae7ca82387209779fefddd34 (patch) | |
| tree | 2da044a8b7ebe835363145a739ed09561e5460bd /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels | |
| parent | 6ec4f8acc13384edb04b96c01c3e87b7681304d7 (diff) | |
| download | Tango-b9c104e259ca24d2ae7ca82387209779fefddd34.tar.gz Tango-b9c104e259ca24d2ae7ca82387209779fefddd34.zip | |
Implemented machine studio connection via access token WORKING!.
Implemented machine studio login method selection.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs index cf34764d9..9c2367f93 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs @@ -102,6 +102,21 @@ namespace Tango.MachineStudio.UI.ViewModels set { _enableSlotSelection = value; RaisePropertyChangedAuto(); } } + private bool _isActiveDirectory; + public bool IsActiveDirectory + { + get { return _isActiveDirectory; } + set { _isActiveDirectory = value; RaisePropertyChangedAuto(); if (value) IsStandardUser = false; } + } + + private bool _isStandardUser; + public bool IsStandardUser + { + get { return _isStandardUser; } + set { _isStandardUser = value; RaisePropertyChangedAuto(); if (value) IsActiveDirectory = false; } + } + + /// <summary> /// Gets or sets the login command. @@ -131,6 +146,15 @@ namespace Tango.MachineStudio.UI.ViewModels Email = _settings.LastLoginEmail; DeploymentSlot = _settings.DeploymentSlot; RememberMe = _settings.RememberMe; + + if (_settings.LastLoginMethod == LoginMethod.ActiveDirectory) + { + IsActiveDirectory = true; + } + else + { + IsStandardUser = true; + } try { @@ -154,11 +178,13 @@ namespace Tango.MachineStudio.UI.ViewModels IsLogging = true; InvalidateRelayCommands(); + LoginMethod loginMethod = IsActiveDirectory ? LoginMethod.ActiveDirectory : LoginMethod.StandardUser; + await Task.Factory.StartNew(() => { _settings.DeploymentSlot = DeploymentSlot; - LoginResponse result = _authenticationProvider.Login(Email, Password, _settings.ByPassEnvironmentVersionCheck).Response; + LoginResponse result = _authenticationProvider.Login(Email, Password, loginMethod, _settings.ByPassEnvironmentVersionCheck).Response; if (result.VersionChangeRequired && !_settings.ByPassEnvironmentVersionCheck) { @@ -183,6 +209,7 @@ namespace Tango.MachineStudio.UI.ViewModels _settings.LastLoginEmail = Email; _settings.RememberMe = RememberMe; + _settings.LastLoginMethod = loginMethod; _settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null; _settings.Save(); |
