diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-10-16 17:31:51 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-10-16 17:31:51 +0300 |
| commit | 4954a924b8a5b8fd7a213a444027e74b936359be (patch) | |
| tree | d91859a5fadf3d21b7fca106a000b30365f78a1b /Software/Visual_Studio/Tango.Web | |
| parent | 583d3716e37a9be80c8bb248215f343ed4fcd2d1 (diff) | |
| download | Tango-4954a924b8a5b8fd7a213a444027e74b936359be.tar.gz Tango-4954a924b8a5b8fd7a213a444027e74b936359be.zip | |
Added support for token authentication from MS to DB.
Diffstat (limited to 'Software/Visual_Studio/Tango.Web')
| -rw-r--r-- | Software/Visual_Studio/Tango.Web/SQLServer/SQLServerManager.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.Web/SQLServer/SQLServerManager.cs b/Software/Visual_Studio/Tango.Web/SQLServer/SQLServerManager.cs index 5c41738a7..ce83d387c 100644 --- a/Software/Visual_Studio/Tango.Web/SQLServer/SQLServerManager.cs +++ b/Software/Visual_Studio/Tango.Web/SQLServer/SQLServerManager.cs @@ -12,12 +12,12 @@ namespace Tango.Web.SQLServer { private String _service_root = $"https://login.microsoftonline.com/{WebConfig.TENANT_ID}"; - public String GetAccessToken() + public AuthenticationResult GetAccessToken() { var authContext = new AuthenticationContext(_service_root); ClientCredential clientCredentials = new ClientCredential(WebConfig.CLIENT_ID, WebConfig.APP_SECRET); AuthenticationResult authResult = authContext.AcquireTokenAsync("https://database.windows.net/", clientCredentials).Result; - return authResult.AccessToken; + return authResult; } public SqlConnection CreateSqlConnection(String accessToken, String catalog) |
