示例#1
0
 public ActiveDirectoryAuthentication(ActiveDirectoryAuthentication.AuthMethod authMethod, String aadTenant, String clientId, String clientSecret)
 {
     _authMethod   = authMethod;
     _aadTenant    = aadTenant;
     _clientId     = clientId;
     _clientSecret = clientSecret;
 }
示例#2
0
        private void FormExecute_Load(object sender, EventArgs e)
        {
            if (!String.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["DefaultSubscriptionId"]))
            {
                this._subscriptionId = ConfigurationManager.AppSettings["DefaultSubscriptionId"];
            }

            if (!String.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["DefaultAadTenant"]))
            {
                this._aadTenant = ConfigurationManager.AppSettings["DefaultAadTenant"];
            }

            if (!String.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["DefaultClientId"]))
            {
                this._clientId = ConfigurationManager.AppSettings["DefaultClientId"];
            }

            if (!String.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["DefaultClientSecret"]))
            {
                this._clientSecret = ConfigurationManager.AppSettings["DefaultClientSecret"];
            }

            if (!String.IsNullOrWhiteSpace(this._clientId) && !String.IsNullOrWhiteSpace(this._clientSecret))
            {
                this._managementAuthenticationMethod = ActiveDirectoryAuthentication.AuthMethod.ServicePrincipal;
            }
            else if (!String.IsNullOrWhiteSpace(this._clientId))
            {
                this._managementAuthenticationMethod = ActiveDirectoryAuthentication.AuthMethod.Login;
            }
            else
            {
                this._managementAuthenticationMethod = ActiveDirectoryAuthentication.AuthMethod.ManagedIdentity;
            }

            CBMethod.SelectedIndex = 0;

            SetUiSate();
        }
示例#3
0
        private void OptionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormOptions OptionForm = new FormOptions()
            {
                SelectedAuthenticationMethod = _managementAuthenticationMethod,
                SubscriptionId = _subscriptionId,
                ClientId       = _clientId,
                ClientSecret   = _clientSecret,
                AadTenant      = _aadTenant
            };

            if (OptionForm.ShowDialog(this) == DialogResult.OK)
            {
                this._managementAuthenticationMethod = OptionForm.SelectedAuthenticationMethod;
                this._subscriptionId = OptionForm.SubscriptionId;
                this._clientId       = OptionForm.ClientId;
                this._clientSecret   = OptionForm.ClientSecret;
                this._aadTenant      = OptionForm.AadTenant;

                SetUiSate();
            }
        }
示例#4
0
 public KeyVaultManagementSdk(String subscriptionId, ActiveDirectoryAuthentication.AuthMethod authMethod, String aadTenant, String clientId, String clientSecret) : this(subscriptionId, new ActiveDirectoryAuthentication(authMethod, aadTenant, clientId, clientSecret))
 {
 }