0
我跟着這個例子得到隱式流工作。Thinktecture隱式流:註銷/註銷用戶
我的問題是,我怎麼會signout用戶?我希望有人知道,因爲我沒有找到任何例子。現在我可以觸發授權窗口並正確處理它,併爲我的請求使用訪問令牌,但我不知道如何設置它以便切換用戶。
我跟着這個例子得到隱式流工作。Thinktecture隱式流:註銷/註銷用戶
我的問題是,我怎麼會signout用戶?我希望有人知道,因爲我沒有找到任何例子。現在我可以觸發授權窗口並正確處理它,併爲我的請求使用訪問令牌,但我不知道如何設置它以便切換用戶。
要註銷,您必須使用註銷方法創建自定義控制器。
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;
}