Azure AD B2C 域 cookie

Azure AD B2C domain cookie

我有一个在 service.domain.de 下运行的网络应用程序。对于此应用程序中的身份验证,我使用 Azure AD B2C。在 azure 安全 cookie 中是针对域 service.domain.de 的。我该怎么做才能获得域 .domain.de 的安全 cookie?因此,对于域 .domain.de,cookie 适用于 domain.de 和所有子域。 我在 ASP.Net 中编写并使用 Microsoft.Owin.Security 库(OpenId)的服务。

添加 CookieAuthentication 时,您可以通过 CookieAuthenticationOptions' CookieDomain 控制域,如下所示:

app.UseCookieAuthentication(new CookieAuthenticationOptions {
  CookieDomain = "domain.de"
});