Owin -Authentifizierung, das aktuelle Token ablaufen und den Keks entfernen

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Owin -Authentifizierung, das aktuelle Token ablaufen und den Keks entfernen

by Anonymous » 25 Aug 2025, 09:06

Ich habe eine Owin Middleware für die Authentifizierung. Wir haben zwei Authentifizierungstypen.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>

und Zweiter Typ Verwendenapp.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>

Wenn der Benutzeranmeldung tatsächlich zwei Abmeldungen < /p>

ausgebenRequest.GetOwinContext().Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie);
< /code>

und < /p>

Request.GetOwinContext().Authentication.SignOut(DefaultAuthenticationTypes.ExternalBearer);
< /code>

Mit dem ersten erwarte ich, dass das aus dem Browser gelöschte .aspnet.externalcookie -Cookie nicht. Melden Sie sich die aktuelle Identität für die aktuelle Sitzung an?
2) Entfernen Sie den externen Keks aus dem Browser?>

Top