【发布时间】:2020-04-18 06:54:46
【问题描述】:
我创建了一个配置了 Azure AD 的 MVC 应用程序。所以所有的身份验证设置都是自动化的。
但我想将用户会话存储在 Azure Redis 缓存中。因为我将使用多个实例
我知道如何在 azure 中设置 redis 缓存。但是我可以从哪里在缓存中添加 Session 呢?
因为我只有这个代码
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = clientId,
Authority = authority,
PostLogoutRedirectUri = postLogoutRedirectUri
});
}
【问题讨论】:
标签: c# azure azure-active-directory azure-redis-cache