private void Identify_CheckSecretExistsWithDialog_Click(object sender, RoutedEventArgs e) { LogTextBox.Clear(); try { var secretName = InputBox.Show("Secret name:"); Log("Secret name: {0}", secretName); var dialog = new IdentificationDialog(); dialog.Title = ".NET SDK Sample"; dialog.Description = ((Button)sender).Content.ToString(); dialog.ParentWindow = new WindowInteropHelper(this).Handle; if (dialog.ShowDialog()) { Log("OK"); Log("User name: {0}", dialog.UserName); Log("Authenticated credentials: {0}", String.Join(", ", dialog.AuthenticatedCredentials)); var secretExists = dialog.SecretExists(secretName); Log("Secret exists: {0}", secretExists); } else { Log("Cancelled"); } } catch (Exception ex) { Log("Error: {0}", ex.Message); } }
private void Identify_CustomPolicy_Click(object sender, RoutedEventArgs e) { LogTextBox.Clear(); try { var policy = new ulong[] { 1 | 2, 4 }; // password+fingerprints or smartcards Log("Custom policy: {0}", String.Join(", ", policy)); var dialog = new IdentificationDialog(); dialog.Title = ".NET SDK Sample"; dialog.Description = ((Button)sender).Content.ToString(); dialog.ParentWindow = new WindowInteropHelper(this).Handle; dialog.AuthenticationPolicy = policy; Log("Show dialog"); if (dialog.ShowDialog()) { Log("OK"); Log("User name: {0}", dialog.UserName); Log("Authenticated credentials: {0}", String.Join(", ", dialog.AuthenticatedCredentials)); } else { Log("Cancelled"); } } catch (Exception ex) { Log("Error: {0}", ex.Message); } }
private void Identify_CheckSecretExists_Click(object sender, RoutedEventArgs e) { LogTextBox.Clear(); try { var userName = InputBox.Show("User name:"); var secretName = InputBox.Show("Secret name:"); Log("User name: {0}", userName); Log("Secret name: {0}", secretName); var dialog = new IdentificationDialog(); dialog.Title = ".NET SDK Sample"; dialog.Description = ((Button)sender).Content.ToString(); dialog.ParentWindow = new WindowInteropHelper(this).Handle; dialog.UserName = userName; var sercetExists = dialog.SecretExists(secretName); Log("Secret exists: {0}", sercetExists); } catch (Exception ex) { Log("Error: {0}", ex.Message); } }
private void Identify_SpecefiedUserName_Click(object sender, RoutedEventArgs e) { LogTextBox.Clear(); try { var dialog = new IdentificationDialog(); dialog.Title = ".NET SDK Sample"; dialog.Description = ((Button)sender).Content.ToString(); dialog.ParentWindow = new WindowInteropHelper(this).Handle; dialog.UserName = "******"; Log("UserName: {0}", dialog.UserName); Log("Show dialog"); if (dialog.ShowDialog()) { Log("OK"); Log("User name: {0}", dialog.UserName); Log("Authenticated credentials: {0}", String.Join(", ", dialog.AuthenticatedCredentials)); } else { Log("Cancelled"); } } catch (Exception ex) { Log("Error: {0}", ex.Message); } }