Ejemplo n.º 1
0
        public async Task <SnowflakeTenant> GetReaderAsync(string clientName)
        {
            SnowflakeTenant t = new SnowflakeTenant();

            //authenticator=https://<your_okta_account_name>.okta.com

            if (_connection.State == System.Data.ConnectionState.Open)
            {
                _connection.Close();
            }
            await _connection.OpenAsync();

            var x = await _connection.QueryAsync <Share>($"show managed accounts like '{clientName}_READER'", null, null, 10, System.Data.CommandType.Text);

            var share = x.Where(i => i.name.StartsWith(clientName)).First();

            t.Locator = share.locator;
            t.OvcId   = share.comment.Trim();
            t.Name    = clientName;
            _connection.Close();

            Tenant = t;

            return(t);
        }