Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IMAP OAuth token expiry

Tags:

oauth

gmail

imap

Following http://code.google.com/apis/gmail/oauth/protocol.html#imap I'm 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 retry using the same XOAUTH value, I get an invalid credentials.

It might 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 everytime or do I need to regenerate it just before trying to access?

My understanding was that once I have the Access Token and Token Secrets back I can use them to generate the XOAUTH value once and then keep using it.

like image 618
Khash Avatar asked Sep 05 '25 21:09

Khash


1 Answers

Using the reliable method of trial and error I figured although access token and secret are long living but the XOAUTH value has to be generated for IMAP every time.

like image 195
Khash Avatar answered Sep 09 '25 03:09

Khash