本文介绍了Chrome应用程序Picasa身份:OAuth2请求失败:服务响应并显示错误:“错误的客户端ID:{0}"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用chrome.identity.getAuthToken()授权以获取Picasa网络服务的令牌.我在Google Developer Console中找不到Picasa API,并将其范围设置为" https://picasaweb.google.com /data/" manifest.json的oauth2部分. Picasa文档说,我可以跳过此步骤.

I'm trying to authorize with chrome.identity.getAuthToken() to get token for Picasa web service. I couldn't find Picasa API in Google Developer Console and set its scope to "https://picasaweb.google.com/data/" oauth2 part of manifest.json. Picasa docs say that I can skip this step.

chrome.identity.getAuthToken({
    interactive: true
}, function (token) {
    if (chrome.runtime.lastError) {
        console.error(chrome.runtime.lastError);
    } else {
        console.log(token);
    }
});

getAuthToken()始终以错误"OAuth2请求失败:服务响应并返回错误:'错误的客户端ID:{0}'"结束.如果未设置范围,则该错误看起来像"OAuth2请求失败".我在哪里弄错了?

getAuthToken() always ends with an error "OAuth2 request failed: Service responded with error: 'bad client id: {0}'". If no scopes are set, the error looks like "OAuth2 request failed". Where have I mistaken?

推荐答案

这似乎很棒,但是经过1天,一切都正常了:)

It seems amazing but after 1 day has passed, everything is working :)

UPD:我已经尝试过 chrome-app-samples 回购中的gdrive示例,添加了Picasa的范围.一切正常后,我将其密钥和oauth2部分复制到了应用程序的清单中.一切也正常.之后,我在开发人员控制台中删除了app的client_id并再次创建了它.之后一切都很好.

UPD: I've tried gdrive sample from chrome-app-samples repo and added scope for Picasa. After everything worked fine, I copied its key and oauth2 section to my app's manifest. Everything worked fine too. After this I deleted client_id for app in developer console and created it again. And after that everything was ok.

这篇关于Chrome应用程序Picasa身份:OAuth2请求失败:服务响应并显示错误:“错误的客户端ID:{0}"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-24 03:06