Example #1
0
 public void SetCurrentUser(IConnectionString connectionString)
 {
     if (connectionString is TextualConnectionString)
     {
         var oracleConnectionString = new OracleConnectionString(((TextualConnectionString)connectionString).ConnectionString);
         SetCurrentUserToOracleConnectionString(oracleConnectionString);
         connectionString.ConnectionString = oracleConnectionString.ConnectionString;
     }
     else if (connectionString is OracleConnectionString)
     {
         SetCurrentUserToOracleConnectionString((OracleConnectionString)connectionString);
     }
 }
Example #2
0
 public void SetCurrentUser(IConnectionString connectionString)
 {
     if (connectionString is TextualConnectionString)
     {
         var oracleConnectionString = new OracleConnectionString(((TextualConnectionString)connectionString).ConnectionString);
         SetCurrentUserToOracleConnectionString(oracleConnectionString);
         connectionString.ConnectionString = oracleConnectionString.ConnectionString;
     }
     else if (connectionString is OracleConnectionString)
     {
         SetCurrentUserToOracleConnectionString((OracleConnectionString)connectionString);
     }
 }
Example #3
0
        private void SetCurrentUserToOracleConnectionString(OracleConnectionString oracleConnectionString)
        {
            lock (this)
            {
                if (oracleConnectionString.HasProxyUserAndPassword)
                {
                    oracleConnectionString.User = OracleUserId;
                    oracleConnectionString.Password = null;
                }

                if (!oracleConnectionString.HasUser &&
                    !oracleConnectionString.HasProxyUserAndPassword)
                {
                    oracleConnectionString.User = OracleUserId;
                    var passwordGenerator = new PasswordGenerator(_identity);
                    oracleConnectionString.Password = passwordGenerator.GeneratePassword();
                }
            }
        }
Example #4
0
        private void SetCurrentUserToOracleConnectionString(OracleConnectionString oracleConnectionString)
        {
            lock (this)
            {
                if (oracleConnectionString.HasProxyUserAndPassword)
                {
                    oracleConnectionString.User     = OracleUserId;
                    oracleConnectionString.Password = null;
                }

                if (!oracleConnectionString.HasUser &&
                    !oracleConnectionString.HasProxyUserAndPassword)
                {
                    oracleConnectionString.User = OracleUserId;
                    var passwordGenerator = new PasswordGenerator(_identity);
                    oracleConnectionString.Password = passwordGenerator.GeneratePassword();
                }
            }
        }