public ActiveDirectoryAuthentication(ActiveDirectoryAuthentication.AuthMethod authMethod, String aadTenant, String clientId, String clientSecret) { _authMethod = authMethod; _aadTenant = aadTenant; _clientId = clientId; _clientSecret = clientSecret; }
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(); }
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(); } }
public KeyVaultManagementSdk(String subscriptionId, ActiveDirectoryAuthentication.AuthMethod authMethod, String aadTenant, String clientId, String clientSecret) : this(subscriptionId, new ActiveDirectoryAuthentication(authMethod, aadTenant, clientId, clientSecret)) { }