【问题标题】:Insert Into fusion table using javascript and oauth2使用javascript和oauth2插入融合表
【发布时间】:2012-09-05 21:20:27
【问题描述】:

请查看http://www.udayan2k12.com/trial.html

我刚刚从 Google 链接(来源)复制了来源
原创页面link
我已更改客户端 ID 和 api 密钥
这仍然不起作用

我的客户 ID 详细信息是 ![在此处输入图片描述][1]

客户 ID:365219651081-istfrdgsvrtj324sufau0ldi5e8b3fmk.apps.googleusercontent.com
邮箱:365219651081-istfrdgsvrtj324sufau0ldi5e8b3fmk@developer.gserviceaccount.com
客户端密码:--
重定向 URI:无
JavaScript 来源:https://www[dot]udayan2k12[dot]com
API密钥:AIzaSyA0FVy-lEr_MPGk1p_lHSrxGZDcxy6wH4o

我应该做些什么改变才能让它发挥作用。 授权按钮不起作用。

但它适用于 http://udayan2k12[dot]com/token.html

【问题讨论】:

    标签: insert client oauth-2.0 google-fusion-tables


    【解决方案1】:

    如果您检查错误控制台,您会看到以下错误:

    Failed to load resource: the server responded with a status of 400 (Bad Request) https://accounts.google.com/o/oauth2/auth?client_id=365219651081-istfrdgsvrtj324sufau0ldi5e8b3fmk.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffusiontables&immediate=true&redirect_uri=postmessage&origin=http%3A%2F%2Fwww.udayan2k12.com&proxy=oauth2relay665167919&response_type=token&state=225646027&authuser=0
    

    当你关注link时,你得到的错误信息是:origin_mismatch

    这意味着您没有将 http://udayan2k12.com(而不是 https)添加到您的客户端 ID 允许的 JavaScript 来源。您可以在Google API Console(选项卡“API 访问”)上更改它。您也可以添加 localhost,这样它也可以在您的机器上运行。

    这是我的设置示例:

    请查看OAuth 2.0 guide from Google 了解您需要的所有步骤。

    【讨论】:

    • 谢谢你的救命稻草 :-) 我用的是 https 而不是 http :0
    猜你喜欢
    • 1970-01-01
    • 2012-04-16
    • 1970-01-01
    • 2012-05-03
    • 2014-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多