OAuth IMAP Token Duration

After http://code.google.com/apis/gmail/oauth/protocol.html#imap I am trying to implement an IMAP client for Gmail that uses OAuth.

My code works fine and I can connect to the IMAP server, however, after 1 day, when I repeat using the same XOAUTH value, I get invalid credentials.

This may be a problem in my code causing this, but I need to know if I can pass the same XOAUTH value to the IMAP AUTHENTICATE method every time, or do I need to restore it just before I try to access it?

My understanding was that as soon as I have access tokens and tokens, I can use them to generate the XOAUTH value once, and then continue to use it.

+3
source share
1 answer

Using a reliable trial and error method, I realized that access tokens and secrets are long-lasting, but an XOAUTH value must be generated for IMAP every time.

+2
source

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


All Articles