在此网页上: code.google/apis/ accounts / docs / OAuth2UserAgent.html Google会向与其API交谈的客户端应用程序执行oauth指令。
On this page: code.google/apis/accounts/docs/OAuth2UserAgent.html Google gives instructions for doing oauth with client side applications that talk to their apis.
一步是调用其令牌验证api。但是如果我想从javascript这样做,它将需要一个跨域的ajax请求。
One step is to call their token validation api. But if I want to do this from javascript, it would require an ajax request which is cross domain.
似乎与所有的跨域的东西的改进,这应该可能,但我不是想弄明白。
It seems like with all the improvements to cross domain stuff recently this should be possible, but I'm not figuring it out. Any pointers would be helpful.
推荐答案如果你想要一个完全基于浏览器的解决方案,你应该考虑使用 Google API JavaScript客户端。以下是有关如何使用该库进行身份验证的文档: https: //code.google/p/google-api-javascript-client/wiki/Authentication
If you want a completely browser-based solution, you should consider using the Google APIs JavaScript client. Here is the documentation on how to do auth using that library: code.google/p/google-api-javascript-client/wiki/Authentication
更多推荐
Google oauth javascript跨域
发布评论