首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Thinktecture隐式流程:注销/注销用户

Thinktecture隐式流程:注销/注销用户
EN

Stack Overflow用户
提问于 2013-06-27 05:47:20
回答 1查看 1.6K关注 0票数 0

我遵循了这个例子来让隐式流工作。

http://weblogs.thinktecture.com/cweyer/2012/11/oauth2-in-thinktecture-identityserver-v2-implicit-grant-flow-with-javascript.html

我的问题是,我该如何给用户签名呢?我希望有人知道,因为我还找不到任何例子。现在,我可以触发授权窗口并正确处理它,并对我的请求使用访问令牌,但我不知道如何才能切换用户。

EN

回答 1

Stack Overflow用户

发布于 2013-08-19 00:32:50

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

代码语言:javascript
复制
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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17331058

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档