javascript - Google 登录 API - 附加范围(Gmail 发送方式)
问题描述
我正在我的应用上实施 Google 登录。使用他们位于此处的分步指南:
https://developers.google.com/identity/sign-in/web/sign-in
对于其他范围,我这样做:
var options = new gapi.auth2.SigninOptionsBuilder(
{'scope': 'email https://www.googleapis.com/auth/gmail.compose'});
googleUser = auth2.currentUser.get();
googleUser.grant(options).then(
function(success){
console.log(JSON.stringify({message: "success", value: success}));
},
function(fail){
alert(JSON.stringify({message: "fail", value: fail}));
});
Evreything 正在工作,但我对如何以当前登录用户身份发送电子邮件感到困惑。我需要向 Google 索要刷新令牌吗?如果是这样,怎么做?我假设我没有向 Google 要求刷新令牌,因为我已经授权了范围。我如何以当前登录用户的身份撰写电子邮件?
谢谢,
解决方案
推荐阅读
- javascript - 如何以用户在 jquery 中输入的次数显示相同的 div?
- node.js - 我想要一个每天自动递减值的函数
- haskell - 如何在编译器中实现源映射?
- linux - 在第三个目录的两个文件之间创建符号链接
- pycharm - 你能在一个活跃的 anaconda 环境中运行 pycharm 的调试器吗?
- javascript - 扩展带有标题和隐藏 div 的 div(一个框)
- angular - 如何从 Angular 7 中网站 URL 的响应标头中获取 X-Frame-Options 值?
- string - 如何连接数字字符串
- python-imaging-library - 在 PIL 与 ndarray 中处理 Height-Width 与 Width-Height 坐标顺序
- python - 为什么标签文本传递给方法,而文本输入文本没有?