A cloud-based identity and access management service for securing user authentication and resource access
Authenticate with AcquireTokenInteractive and use security key as default
I have a C# program (Windows Application .NET 7.0) for logging in to Azure using Web Account Manager (WAM). This works fine but I would like to have "Sign in with a security key" as the default sign-in option. Currently I get a dialog where I can type in user name or choose "Sign-in options" and then choose security key. Is it possible to specify default sign-in option?
private void button1_Click(object sender, EventArgs e)
{
var hwnd = this.Handle;
var client_id = "....";
var tenant_id = "....";
var options = new BrokerOptions(BrokerOptions.OperatingSystems.Windows);
var pca = PublicClientApplicationBuilder.Create(client_id)
.WithBroker(options)
.Build();
var authResult = pca.AcquireTokenInteractive(new[] { "User.Read" })
.WithAuthority(AzureCloudInstance.AzurePublic, tenant_id)
.WithParentActivityOrWindow(hwnd)
.ExecuteAsync();
}
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Developer technologies | .NET | Other
Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.