• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

桌面MFC应用程序的授权码授予类型

用户头像
it1352
帮助1

问题说明

我正在开发一个使用TradeStation WebAPI的桌面MFC应用程序( http://tradestation.github. io/webapi-docs/). WebAPI提供授权代码授予类型"( http://tradestation.github.io/webapi-docs/en/getting-started/security-overview/),如下所示:1)客户端应用程序会将最终用户路由到我们的MFA(多因素身份验证)登录页面网页. 2)认证成功;用户代理(浏览器)将被重定向到提供的URL,并在查询字符串中包含授权码. 3)其他一些东西...

I'm developing a desktop MFC application which uses TradeStation WebAPI (http://tradestation.github.io/webapi-docs/). The WebAPI provides "Authorization Code Grant Type" (http://tradestation.github.io/webapi-docs/en/getting-started/security-overview/) which is the following: 1) The client application will route the end-user to our MFA (multi-factor authentication) login page web page. 2) Upon successful authentication; The user agent(browser) will be redirected to the URL provided and include an Authorization Code in the query string. 3) Some other stuff...

问题是我不知道如何从第2步中获取代码.我看了一些示例,发现只有两种方法.

The problem is I don't know how to obtain the code from the step 2. I've looked some examples and found only two approaches.

  1. MFC应用程序实现嵌入式浏览器(而不是使用 WebBrowser ActiveX控件派生的默认系统浏览器) 并实现BeforeNavigate事件处理程序以获取代码 重定向.缺点-嵌入式浏览器的实现过于繁琐,无法获得唯一的代码,此外,不信任嵌入式浏览器的用户可能会拒绝它.
  2. 应用程序使用默认的系统浏览器,该浏览器重定向到网站.该网站接受该代码,然后将其传递给应用程序.缺点-需要一个网站.
  1. MFC application implements an embedded browser (rather than using the default system browser) derived from WebBrowser ActiveX control and implements BeforeNavigate event handler to get the code on redirection. Drawback - the embedded browser implementation is too heavy to obtain the only code, moreover it may be rejected by users who don't trust embedded browsers.
  2. The application uses the default system browser which is redirected to a web site. The web site accepts the code and then passes it to the application. Drawback - a web site required.

两者都有缺点,我想知道是否还有其他方法可以在我的应用程序中实现授权码授予类型".

Both have drawbacks, and I'm wondering if there is other approaches to implement "Authorization Code grant type" in my application.

正确答案

#1

这两种方法都是有效的,因此您应该选择能够提供最佳用户体验的方法.您可以在 http://msdn.microsoft.com/zh-CN/library/aa752046(VS.85).aspx .您不能从TradeStation WebAPI中删除网站要求,因为它主要用于服务Web和移动应用程序.

Both approaches are valid, so you should go with the one that provides the best user experience. You can see more on implementing the embedded browser into your MFC application here http://msdn.microsoft.com/en-us/library/aa752046(VS.85).aspx. You cannot remove the website requirement from the TradeStation WebAPI as it is designed primarily to service web and mobile applications.

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcgkjgc
系列文章
更多 icon
同类精品
更多 icon
继续加载