WinRT Javascript 应用程序中的 Google API OAuth 2.0

Google API OAuth 2.0 in WinRT Javascript Application

本文关键字:API OAuth Google Javascript 应用程序 WinRT      更新时间:2023-09-26

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

有什么建议吗?

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) {
}

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