Share via

Authenticate with AcquireTokenInteractive and use security key as default

Anonymous
2023-11-24T08:27:11+00:00

I have a C# program (Windows Application .NET 7.0) for logging in to Azure using Web Account Manager (WAM):

    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(); 

    } 

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?

Windows for home | Windows 10 | Security and privacy

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. paulr0511 45,615 Reputation points Independent Advisor
    2023-11-24T08:59:30+00:00

    Good day ArneI! I am glad to be able to provide assistance to you today. I would suggest to post this query to our neighbor forum from the link below as this is best suited in there. They are more oriented on with regards to this type queries/issues and there will be IT Pros and Gurus/Developers, Programmers and the likes who has the same deployment or setup in this type of environment and are available that will be able to fulfill your query out there.

    https://learn.microsoft.com/en-us/answers/

    Regards,

    Paul R.

    Was this answer helpful?

    0 comments No comments