MicrosoftDX / AuthBot

General authentication/authorization Bot Framework sample
MIT License
82 stars 54 forks source link

Exception: Stack is empty? #31

Closed megancooper closed 7 years ago

megancooper commented 7 years ago

I am following the v2 example. I have the same code in my dialog class as listed here except my class' name is LoginDialog.cs. I see this exception in the emulator however:

err

My Web.config looks like the following:

config

I know I'm doing something wrong but I'm not sure what?

megancooper commented 7 years ago

Needed to list the Active Directory values in the Global.asax.cs file like so:

        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);

            AuthSettings.Mode = ConfigurationManager.AppSettings["ActiveDirectory.Mode"];
            AuthSettings.EndpointUrl = ConfigurationManager.AppSettings["ActiveDirectory.EndpointUrl"];
            AuthSettings.Tenant = ConfigurationManager.AppSettings["ActiveDirectory.Tenant"];
            AuthSettings.RedirectUrl = ConfigurationManager.AppSettings["ActiveDirectory.RedirectUrl"];
            AuthSettings.ClientId = ConfigurationManager.AppSettings["ActiveDirectory.ClientId"];
            AuthSettings.ClientSecret = ConfigurationManager.AppSettings["ActiveDirectory.ClientSecret"];
        }