ionic-framework - 如何获得谷歌 IdToken?
问题描述
我正在使用这个插件:cordova-plugin-googleplus
用户Gmail
正确选择后,我得到一个包含许多不同用户信息的对象
在后端我使用Java并遵循本教程: backend-auth
现在我遇到的问题是我只能通过 获取访问令牌googleplus plugin
,但我需要一个 IDToken。这是我使用的代码:
this.googlePlus.login({webclientId:'778525824123-83qa65tspdfd5c6i6roquf3dd41m3nk8.apps.googleusercontent.com'})
.then(res => {
console.log(res);
}
)
.catch(err => console.error(err));
也许我的 webclientId 有问题?我不知道。
解决方案
我通过不使用 npm 版本解决了它,我使用了:
ionic cordova 插件添加https://github.com/EddyVerbruggen/cordova-plugin-googleplus ......