2013-06-26 56 views

回答

0

要注销,您必须使用注销方法创建自定义控制器。

public void Logout() 
{ 
    // You should be able to revoke thinktecture token like this. (haven't tested this out) 
    var sam = FederatedAuthentication.SessionAuthenticationModule; 
    sam.SignOut(); 

    // Or you should be able to logoff like this when using a membership provider. (this way works for me) 
    //_yourMembership.Logout(); 
    Thread.CurrentPrincipal = null; 
    HttpContext.Current.User = null; 
} 

这里是令牌撤销的样品: https://github.com/brockallen/BrockAllen.MembershipReboot/blob/master/src/BrockAllen.MembershipReboot/Authentication/SamAuthenticationService.cs