【发布时间】:2014-01-20 02:36:45
【问题描述】:
我知道 OAuth 的概念是什么:用户使用授权类型、用户名和密码向服务器发送请求,在服务器上进行一些检查后,用户会收到一个访问令牌。 我无法理解的是我为什么要这样做:
ClaimsIdentity oAuthIdentity = await _userManager.CreateIdentityAsync(user,
context.Options.AuthenticationType);
var ticket = new AuthenticationTicket(oAuthIdentity, GenerareProperties(user));
context.Validated(ticket);
CreateIdentityAsync 返回的是什么?什么是AuthenticationTicket? context.Validated 是做什么的?
另外,如果我有oAuthIdentity,为什么还要使用cookiesIdentity?最后,访问令牌在哪里生成?
我搜索但找不到解释此问题的网站。
【问题讨论】:
标签: asp.net-web-api oauth-2.0 asp.net-mvc-5 asp.net-web-api2 asp.net-authorization