1

I want to load CookieDomain and set the external providers based on values from database, but it seems like HttpContext.Current.Request.Url.Host is not yet set when Startup is calling ConfigureAuth(app); (value is always 127.0.0.1)

How can I get the current host name to be available at Startup?

So, for example, if I have Web1.com, Web2.com ... all bound to the same web application, I want ConfigureAuth to use values that are specific to that host name (CookieDomain, CookieName, facebookAuthOptions.AppId, facebookAuthOptions.AppSecret etc...)

Yovav
  • 2,557
  • 2
  • 32
  • 53
  • I don't think there's a way to enumerate addresses at startup in IIS. This kind of information is usually provided via config file. – Tratcher Jun 23 '16 at 21:05
  • Maybe there's a way to update the providers later on when HttpContext is available, I can maybe handle the cookie later with a custom cookie (ICookieManager) ,but no idea how to update the external providers (each web site has its own app key and secret) – Yovav Jun 24 '16 at 06:25
  • I don't recommend trying to reconfigure the app after startup, you'll hit nasty race conditions. Instead, come up with a deployment process that provisions this information per site. – Tratcher Jun 24 '16 at 16:46

0 Answers0