How to generate an XOAUTH parameter using OAuth2.0 for use with Gmail IMAP?

I have a user who is allowed to access their gmail through imap using OAuth2.0. I have an OAuth2.0 access token (and an update token). But it's hard for me to figure out how to map this to the XOAUTH parameter. All documentation for generating the XOAUTH parameter is written under the assumption OAuth1.0.

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

+6
source share
1 answer

From my Googling, I don't think it is currently possible to create an XOAUTH parameter for IMAP using the OAuth2 access token. This is what Google really needs to add as soon as possible.

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

+5
source

Source: https://habr.com/ru/post/897920/


All Articles