diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-06-05 13:55:43 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-06-05 13:55:43 +0300 |
| commit | c56ad2e3a5b082b631305b14f3b73bdf9c5f033a (patch) | |
| tree | 629cc3a9d58b1119090f331d3cff7e5a90cf7f37 /Software/Visual_Studio/Tango.Web/ActiveDirectory | |
| parent | 0b9b136140b224a0b885942ee5aef674744aef4f (diff) | |
| download | Tango-c56ad2e3a5b082b631305b14f3b73bdf9c5f033a.tar.gz Tango-c56ad2e3a5b082b631305b14f3b73bdf9c5f033a.zip | |
Upgraded ActiveDirectory libraries to newest version.
Refactored Tango.Web to use the new AD API.
Diffstat (limited to 'Software/Visual_Studio/Tango.Web/ActiveDirectory')
| -rw-r--r-- | Software/Visual_Studio/Tango.Web/ActiveDirectory/ActiveDirectoryManager.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.Web/ActiveDirectory/ActiveDirectoryManager.cs b/Software/Visual_Studio/Tango.Web/ActiveDirectory/ActiveDirectoryManager.cs index a59af83e0..a1eede7ef 100644 --- a/Software/Visual_Studio/Tango.Web/ActiveDirectory/ActiveDirectoryManager.cs +++ b/Software/Visual_Studio/Tango.Web/ActiveDirectory/ActiveDirectoryManager.cs @@ -17,8 +17,8 @@ namespace Tango.Web.ActiveDirectory { var authContext = new AuthenticationContext(_service_root); authContext.TokenCache.Clear(); - UserCredential userCredential = new UserCredential(email, password); - AuthenticationResult authResult = authContext.AcquireToken("https://graph.windows.net/", WebConfig.CLIENT_ID, userCredential); + UserCredential userCredential = new UserPasswordCredential(email, password); + AuthenticationResult authResult = authContext.AcquireTokenAsync("https://graph.windows.net/", WebConfig.CLIENT_ID, userCredential).Result; return authResult; } @@ -26,7 +26,7 @@ namespace Tango.Web.ActiveDirectory { var authContext = new AuthenticationContext(_service_root); ClientCredential clientCredentials = new ClientCredential(WebConfig.CLIENT_ID, WebConfig.APP_SECRET); - AuthenticationResult authResult = authContext.AcquireToken("https://graph.windows.net/", clientCredentials); + AuthenticationResult authResult = authContext.AcquireTokenAsync("https://graph.windows.net/", clientCredentials).Result; return authResult; } |
