Я отлаживаю в сборках ASP.NET Identity 2.x, с тех пор, как я называю подписанную на странице ASPX Webforms в веб -сайте ASP.NET. В этом исходном коде для подписания? Для меня это довольно сложно знать, какая линия кода удаляет автокект авто, так как моя идея удаления файла cookie - это просто истекать, за которым следует добавление его в объект ответа, и нигде в исходном коде выставки истек срок действия cookie.SignOut(string[] authenticationTypes)
< /code>
Метод в исходном коде, который затем вызывает < /p>
SignOut(AuthenticationProperties properties, string[] authenticationTypes)
< /code>
в том же исходном коде. Объект Prorgrant является нулевым, а также Priorrevoke является нулевым. Последняя строка, вызванная исходным кодом, является той, которая говорит < /p>
AuthenticationResponseRevoke = new AuthenticationResponseRevoke(authenticationTypes, properties)
< /code>
код на моей странице ASPX Webforms: < /p>
Context.GetOwinContext().Authentication.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
Исходный код, который визуальный студий 2022 принимает меня, когда вызов выше кода на моей странице называется (эти методы находятся в microsoft.owin.security.authenticationManager class)
public void SignOut(AuthenticationProperties properties, string[] authenticationTypes)
{
AuthenticationResponseGrant priorGrant = AuthenticationResponseGrant;
if (priorGrant != null)
{
// Scan the sign-in's and remove any with a matching auth type.
ClaimsIdentity[] filteredIdentities = priorGrant.Principal.Identities
.Where(identity => !authenticationTypes.Contains(identity.AuthenticationType, StringComparer.Ordinal))
.ToArray();
if (filteredIdentities.Length < priorGrant.Principal.Identities.Count())
{
if (filteredIdentities.Length == 0)
{
AuthenticationResponseGrant = null;
}
else
{
AuthenticationResponseGrant = new AuthenticationResponseGrant(new ClaimsPrincipal(filteredIdentities), priorGrant.Properties);
}
}
}
AuthenticationResponseRevoke priorRevoke = AuthenticationResponseRevoke;
if (priorRevoke == null)
{
AuthenticationResponseRevoke = new AuthenticationResponseRevoke(authenticationTypes, properties);
}
else
{
if (properties != null && !object.ReferenceEquals(properties.Dictionary, priorRevoke.Properties.Dictionary))
{
// Update prior properties
foreach (var propertiesPair in properties.Dictionary)
{
priorRevoke.Properties.Dictionary[propertiesPair.Key] = propertiesPair.Value;
}
}
// Cumulative auth types
string[] mergedAuthTypes = priorRevoke.AuthenticationTypes.Concat(authenticationTypes).ToArray();
AuthenticationResponseRevoke = new AuthenticationResponseRevoke(mergedAuthTypes, priorRevoke.Properties);
}
}
public void SignOut(string[] authenticationTypes)
{
SignOut(new AuthenticationProperties(), authenticationTypes);
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... ie-removed