【发布时间】:2014-11-06 13:11:48
【问题描述】:
我正在尝试将 OAuth 2.0 与我的 Asp.net Mvc 5 应用程序与 salesforce 一起使用。
如何在控制器操作中获取访问令牌,例如 -
[Authorize]
public ActionResult getToken()
{
// I want to get my access token here using some thing like this .
String token = GetOwinContext().GetToken();
}
【问题讨论】:
-
答案来晚了,但也许它可以帮助其他人。我在 3 天前遇到了同样的问题,我通过在
Identity对象中添加承载令牌作为Claim来解决。以下链接显示所有步骤stackoverflow.com/questions/48931314/…
标签: asp.net-mvc asp.net-mvc-4 oauth-2.0 owin