0

I'm trying to authenticate into Azure AD B2C using the following on my mvc controller:

public async Task<ActionResult> AZLogin()
{
    var result = await MsalAppBuilder.BuildPublicClientApplication().AcquireTokenInteractive(Globals.Scopes).ExecuteAsync();
    return null;

}

However I run into this:

ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.

How would I go about doing this?

svyat1s
  • 868
  • 9
  • 12
  • 21
uneatenbreakfast
  • 545
  • 6
  • 15

1 Answers1

0

Try to add [STAThread] attribute to your application entry point method or read that answers as well Single-threaded apartment - cannot instantiate ActiveX control

svyat1s
  • 868
  • 9
  • 12
  • 21