Der erste Typ ist ein Inhabertoken mit der folgenden Konfiguration
Code: Select all
var OAuthOptions = new OAuthAuthorizationServerOptions
{
AuthenticationType = DefaultAuthenticationTypes.ExternalBearer,
TokenEndpointPath = new PathString("/Token"),
Provider = new ApplicationOAuthProvider(PublicClientId),
AccessTokenExpireTimeSpan = TimeSpan.FromDays(14),
AllowInsecureHttp = true,
AccessTokenFormat = new SecureTokenFormatter(GetMachineKey())
};
Code: Select all
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ExternalCookie,
AuthenticationMode = Microsoft.Owin.Security.AuthenticationMode.Passive,
CookieHttpOnly = true,
CookieSecure = CookieSecureOption.SameAsRequest,
CookieName = ".AspNet." + DefaultAuthenticationTypes.ExternalCookie,
ExpireTimeSpan = TimeSpan.FromMinutes(5),
TicketDataFormat = new SecureTokenFormatter(GetMachineKey())
});
Code: Select all
Request.GetOwinContext().Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie);
Code: Select all
Request.GetOwinContext().Authentication.SignOut(DefaultAuthenticationTypes.ExternalBearer);
Beim zweiten erwarte ich, dass das Cookie .AspNet.ExternalCookie aus dem Browser gelöscht wird Ich erwarte, dass mein Token ungültig wird und die User.Current.Identity = null ist, was nicht der Fall ist.
Wie kann ich also
1) mich physisch vom Strom abmelden? Identität für die aktuelle Sitzung?
2) Das externe Cookie aus dem Browser entfernen?