aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core/DataSource.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-12-17 10:20:36 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-12-17 10:20:36 +0200
commit8270aa37dee33cda98603a995de823df393f7294 (patch)
tree3e8ad158fcc8c7cdf8de0806298fcd7dc1f7caa6 /Software/Visual_Studio/Tango.Core/DataSource.cs
parentd8d1128887089087578286f37561dc8942726ba4 (diff)
downloadTango-8270aa37dee33cda98603a995de823df393f7294.tar.gz
Tango-8270aa37dee33cda98603a995de823df393f7294.zip
Added support for azure authentication in data source.
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/DataSource.cs')
-rw-r--r--Software/Visual_Studio/Tango.Core/DataSource.cs39
1 files changed, 12 insertions, 27 deletions
diff --git a/Software/Visual_Studio/Tango.Core/DataSource.cs b/Software/Visual_Studio/Tango.Core/DataSource.cs
index 511a82267..3803eea5d 100644
--- a/Software/Visual_Studio/Tango.Core/DataSource.cs
+++ b/Software/Visual_Studio/Tango.Core/DataSource.cs
@@ -100,35 +100,20 @@ namespace Tango.Core
case DataSourceType.Azure:
- if (IntegratedSecurity)
- {
- throw new NotSupportedException("Azure integrated security is not supported.");
- //if (!_has_provider)
- //{
- // var provider = new ActiveDirectoryAuthProvider();
- // SqlAuthenticationProvider.SetProvider(SqlAuthenticationMethod.ActiveDirectoryInteractive, provider);
- // _has_provider = true;
- //}
-
- //SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
-
- //builder.DataSource = Address;
- //builder.InitialCatalog = Catalog;
- //builder.UserID = UserName;
- //builder.TrustServerCertificate = true;
- //builder.ConnectTimeout = 15;
- //builder.Pooling = false;
-
- //builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryInteractive;
+ SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
+ builder.DataSource = Address;
+ builder.InitialCatalog = Catalog;
+ builder.UserID = UserName;
+ builder.Password = Password;
+ builder.IntegratedSecurity = false;
+ builder.TrustServerCertificate = true;
+ builder.ConnectTimeout = 15;
+ builder.Pooling = false;
+ builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryPassword;
- //SqlConnection sqlConnection = new SqlConnection(builder.ConnectionString);
+ SqlConnection sqlConnection = new SqlConnection(builder.ConnectionString);
- //return sqlConnection;
- }
- else
- {
- return new SqlConnection(String.Format("Server=tcp:{0},1433;Initial Catalog={1};Persist Security Info=False;User ID={2};Password={3};MultipleActiveResultSets=True;App=EntityFramework;Encrypt=True;TrustServerCertificate=False;Authentication=\"Active Directory Password\";", Address, Catalog, UserName, Password));
- }
+ return sqlConnection;
default: