Google oauth javascript cross domain

落爺英雄遲暮 提交于 2019-12-11 03:57:23

问题


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.

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.


回答1:


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



来源:https://stackoverflow.com/questions/8844991/google-oauth-javascript-cross-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!