C# OWIN已通过另一个项目/网站的身份验证

C# OWIN已通过另一个项目/网站的身份验证,c#,asp.net-mvc,authentication,model-view-controller,owin,C#,Asp.net Mvc,Authentication,Model View Controller,Owin,我正在开发两个独立的MVC应用程序。 对于两者,我都实现了OWIN。。。大概是这样的: var identity = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie); this.AuthenticationManager.SignIn(new AuthenticationProperties { AllowRefresh = true,

我正在开发两个独立的MVC应用程序。 对于两者,我都实现了OWIN。。。大概是这样的:

  var identity = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie);

        this.AuthenticationManager.SignIn(new AuthenticationProperties
        {
            AllowRefresh = true,
            IsPersistent = rememberMe,
            ExpiresUtc = DateTime.UtcNow.AddDays(7)
        }, identity);

我的问题:如果我登录到APP1,然后转到APP2,我将自动登录到APP2。

每个项目中的
web.config
文件是否都有明确定义的


如果两个站点位于同一个域(website1.domain.com、website2.domain.com),cookie将持续存在,并尝试解密。因此,如果两个配置文件都定义了密钥并且密钥相同,那么它将假定身份验证


但这取决于您如何定义身份验证,可能不是这样。

private IAAuthenticationManager AuthenticationManager=>This.HttpContext.GetOwinContext().authentication;如果我理解正确,您当前有两个不同的URL,当您登录其中一个URL时,您也会登录第二个URL?@Alexandre YES。我有两个不同的MVC网站,但如果我登录其中一个,我会自动登录另一个。(如果我使用相同的浏览器)-他们以某种方式共享owin cookies。。。是的,这解决了我的问题。我过去用过(大约6-7年前),但记不清了。谢谢
<machineKey decryptionKey="[some value]" validationKey="[some value]" />