一直面临这个问题 “您创建了一个新的客户端应用程序,该应用程序使用库进行用户身份验证或授权,该库很快就会被弃用。新客户端必须使用新库;现有客户端也必须在这些库被弃用之前迁移。请参阅迁移指南了解更多信息。” 如果 Google 已阻止新用户的客户端 ID,现在如何使用 Google 登录
javascript localhost reactjs google-cloud-platform google-developers-console
这是我的初始化代码:
function HandleGoogleApiLibrary() {
// Load "client" & "auth2" libraries
gapi.load('client:auth2', {
callback: function () {
// Initialize client & auth libraries
gapi.client.init({
apiKey: 'My API Key',
clientId: 'My Client ID',
scope: 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/plus.me'
}).then(
function (success) {
console.log("Yaaay");
},
function (error) {
console.log("Nope");
console.log(error);
}
);
},
onerror: function () {
// Failed to load libraries
}
});
}
Run Code Online (Sandbox Code Playgroud)
这给了我以下错误消息:
details: "Not a valid origin for the client: http://127.0.0.1 has not been whitelisted for client ID 388774754090-o7o913o81ldb2jcfu939cfu36kh9h0q6.apps.googleusercontent.com. Please …Run Code Online (Sandbox Code Playgroud)