如何使用 OAuth2.0 生成 XOAUTH 参数以与 Gmail IMAP 协议一起使用?

发布于 2024-12-06 03:04:25 字数 207 浏览 3 评论 0原文

我有一个用户被授权可以使用 OAuth2.0 通过 imap 访问他们的 Gmail。我有 OAuth2.0 访问令牌(和刷新令牌)。但我无法弄清楚如何将其映射到 XOAUTH 参数。所有生成 XOAUTH 参数的文档都是假设 OAuth1.0 编写的。

我可以按照示例代码使其与 OAuth1.0 一起工作。但我的服务器正在使用 OAuth2.0 来做其他事情,我想使用相同的代码。

I have a user authorized to access their gmail through imap using OAuth2.0. I have the OAuth2.0 access token (and refresh token). But I am having trouble figuring out how to map that into an XOAUTH parameter. All the documentation for generating the XOAUTH parameter are written assuming OAuth1.0.

I can follow the sample code make this work with OAuth1.0. But my server is using OAuth2.0 for other things and I want to use the same code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

翻了热茶 2024-12-13 03:04:26

从我的谷歌搜索来看,我认为目前不可能使用 OAuth2 访问令牌为 IMAP 构造 XOAUTH 参数。这是谷歌真正需要尽快添加的东西。

请参阅 http://groups.google.com/group/ oauth2-dev/browse_thread/thread/c1235d5f21e7b438?pli=1

From my Googling, I don't think it's currently possible to construct an XOAUTH param for IMAP using the OAuth2 access token. This is something Google really needs to add ASAP.

See http://groups.google.com/group/oauth2-dev/browse_thread/thread/c1235d5f21e7b438?pli=1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文