Google oauth javascript跨域

编程入门 行业动态 更新时间:2024-10-27 16:27:37
本文介绍了Google oauth javascript跨域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在此网页上: 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跨域

本文发布于:2023-08-06 04:53:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1310184.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:oauth   Google   跨域   javascript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!