【问题标题】:Google API OAuth 2.0 in WinRT Javascript ApplicationWinRT Javascript 应用程序中的 Google API OAuth 2.0
【发布时间】:2012-07-07 16:34:37
【问题描述】:

我目前正在努力在 WinRT Metro Javascript 应用程序中实现 Google API OAuth。问题是我不能provide 任何与 Metro 应用程序一起工作的 redirect_uri。已安装应用程序的 urn:ietf:wg:oauth:2.0:oob URL 不起作用,我无法想象在可以处理重定向的 Javascript 应用程序中托管 HttpListener 的方法。

有什么建议吗?

【问题讨论】:

  • urn:ietf:wg:oauth:2.0:oob URL 到底有什么问题?

标签: javascript oauth oauth-2.0 microsoft-metro windows-runtime


【解决方案1】:
START URI = https://accounts.google.com/o/oauth2/auth?client_id= Ur Client ID &redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile

End URI =https://accounts.google.com/o/oauth2/approval?
Windows.Security.Authentication.Web.WebAuthenticationBroker.authenticateAsync(Windows.Security.Authentication.Web.WebAuthenticationOptions.useTitle, startURI, endURI)
   .then(function (result) {
}

上面是我的代码的一些瞥见,所以我粘贴在这里..你可以试试这个它会帮助你。

【讨论】:

    猜你喜欢
    • 2016-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 2014-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多