Google oauth javascript跨域 [英] Google oauth javascript cross domain

查看:270
本文介绍了Google oauth javascript跨域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此网页上: http://code.google.com/apis/ accounts / docs / OAuth2UserAgent.html Google会向与其API交谈的客户端应用程序执行oauth指令。

On this page: http://code.google.com/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.com/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: https://code.google.com/p/google-api-javascript-client/wiki/Authentication

这篇关于Google oauth javascript跨域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆