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;
}