2
我回顧了一些關於這方面的帖子,但我仍然無法找到對我的問題的答案。 我試圖爲花費更多定義時間的用戶創建自動註銷。例如,如果我指定30分鐘的網絡應用程序需要自動註銷用戶。MVC 5用OWIN自動註銷用戶
我使用OWIN與MVC 5和我Startup.Auth類配置爲:
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
CookieSecure = CookieSecureOption.SameAsRequest,
SlidingExpiration = true,
ExpireTimeSpan = new System.TimeSpan(0, 0, expireMinutes, 0, 0),
});
也:
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseWsFederationAuthentication(
new WsFederationAuthenticationOptions
{
Wreply = WAADReturnURL,
Wtrealm = realm,
MetadataAddress = metadata,
});
app.UseMicrosoftAccountAuthentication(
new Microsoft.Owin.Security.MicrosoftAccount.MicrosoftAccountAuthenticationOptions()
{
ClientId = "xxxx",
ClientSecret = "xxxx",
});
app.UseYahooAuthentication(
new YahooAuthenticationOptions()
{
ConsumerKey = "xxxx",
ConsumerSecret = "xxxx",
});
app.UseLinkedInAuthentication(
new LinkedInAuthenticationOptions()
{
ClientId = "xxxx",
ClientSecret = "xxxx",
});
app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
{
ClientId = "xxxx",
ClientSecret = "xxxx",
});
app.UseFacebookAuthentication(new Microsoft.Owin.Security.Facebook.FacebookAuthenticationOptions()
{
AppId = "xxxx",
AppSecret = "xxxx",
});
我使用WAAD和第三方供應商如Facebook, Linkedin ...
另外我的web.config我設置了以下配置:
<authentication mode="None">
</authentication>
我審查後交也,但沒有解決: MVC 5 Identity Automatic Logout
感謝