aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-02-19 01:50:58 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-02-19 01:50:58 +0200
commit9736b8c8ede6a0d121dea8381f0abb561fad5631 (patch)
tree1c38f3f5be82b923ffae40fae00a25487179ab54 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
parentbe3343cc0268179c7a6f628fa5e68f323a3335e5 (diff)
downloadTango-9736b8c8ede6a0d121dea8381f0abb561fad5631.tar.gz
Tango-9736b8c8ede6a0d121dea8381f0abb561fad5631.zip
Implemented auto generated web clients for PPC and machine studio.
Improved interactions with web clients across solutions.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs23
1 files changed, 13 insertions, 10 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
index d81f0d561..e07952f29 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -26,6 +26,8 @@ namespace Tango.MachineStudio.UI.Authentication
/// <seealso cref="Tango.MachineStudio.Common.Authentication.IAuthenticationProvider" />
public class DefaultAuthenticationProvider : ExtendedObject, IAuthenticationProvider
{
+ private MachineStudioWebClient _client;
+
private User _currentUser;
/// <summary>
/// Gets the current logged-in user.
@@ -47,6 +49,15 @@ namespace Tango.MachineStudio.UI.Authentication
public event EventHandler<User> CurrentUserChanged;
/// <summary>
+ /// Initializes a new instance of the <see cref="DefaultAuthenticationProvider"/> class.
+ /// </summary>
+ /// <param name="machineStudioWebClient">The machine studio web client.</param>
+ public DefaultAuthenticationProvider(MachineStudioWebClient machineStudioWebClient)
+ {
+ _client = machineStudioWebClient;
+ }
+
+ /// <summary>
/// Performs a user login by the specified email and password.
/// </summary>
/// <param name="email">The email.</param>
@@ -57,9 +68,8 @@ namespace Tango.MachineStudio.UI.Authentication
{
var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
- IMachineStudioWebService service = new MachineStudioWebService();
-
- var response = service.Login(new LoginRequest()
+ _client.Environment = settings.DeploymentSlot;
+ var response = _client.Login(new LoginRequest()
{
Email = email,
@@ -68,8 +78,6 @@ namespace Tango.MachineStudio.UI.Authentication
}).Result;
- AccessToken = response.AccessToken;
-
if (settings.Environment == MachineStudioSettings.WorkingEnvironment.Remote)
{
ObservablesContext.OverrideSettingsDataSource(response.DataSource);
@@ -114,10 +122,5 @@ namespace Tango.MachineStudio.UI.Authentication
{
CurrentUser = null;
}
-
- /// <summary>
- /// Gets the access token that was retrieved at the last login.
- /// </summary>
- public string AccessToken { get; private set; }
}
}