AAD 身份验证和 cookie 名称?
AAD auth and cookie name?
我正在使用 ASP.Net Core 2.2 MVC。
我的启动添加了 AddAuthentication
我希望能够配置存储 AAD 令牌的 cookie。
我试图在下面添加这段代码。
但是当我 运行 我的应用程序在 Chrome 时,我在开发工具中看不到 cookie 名称。有什么想法吗?
services.ConfigureApplicationCookie(options =>
{
options.Cookie.Name = "MeAPP";
options.ExpireTimeSpan = TimeSpan.FromMinutes(60);
options.SlidingExpiration = true;
});
您可以通过以下方式重命名 cookie 名称:
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
.AddAzureAD(options => Configuration.Bind("AzureAd", options));
services.Configure<CookieAuthenticationOptions>(AzureADDefaults.CookieScheme, options =>
{
options.Cookie.Name = "MyCookieName";
});
我正在使用 ASP.Net Core 2.2 MVC。
我的启动添加了 AddAuthentication
我希望能够配置存储 AAD 令牌的 cookie。 我试图在下面添加这段代码。 但是当我 运行 我的应用程序在 Chrome 时,我在开发工具中看不到 cookie 名称。有什么想法吗?
services.ConfigureApplicationCookie(options =>
{
options.Cookie.Name = "MeAPP";
options.ExpireTimeSpan = TimeSpan.FromMinutes(60);
options.SlidingExpiration = true;
});
您可以通过以下方式重命名 cookie 名称:
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
.AddAzureAD(options => Configuration.Bind("AzureAd", options));
services.Configure<CookieAuthenticationOptions>(AzureADDefaults.CookieScheme, options =>
{
options.Cookie.Name = "MyCookieName";
});