【问题标题】:How to get access token in Asp.net MVC5 Controller action from OwinContext如何从 OwinContext 获取 Asp.net MVC5 Controller 操作中的访问令牌
【发布时间】: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();
}

【问题讨论】:

标签: asp.net-mvc asp.net-mvc-4 oauth-2.0 owin


【解决方案1】:

我使用正常的 oauth 安全流程进行了操作。(不使用 owin 安全)。

只需点击您的 oauth 登录 url 以返回一个代码,然后使用该代码创建一个 oauth 令牌。

【讨论】:

  • 您愿意补充更多细节吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-28
  • 2018-06-26
  • 2019-09-09
  • 2014-04-09
  • 2020-10-26
  • 2018-01-13
  • 2012-09-16
相关资源
最近更新 更多