PHP IMAP and XOAUTH
I want to access gmail IMAP using XOAUTH with PHP. http://code.google.com/intl/uk/apis/gmail/oauth/protocol.html#imap
I tried samples from page above and i can get get token for AUTHENTICATE XOAUTH . But i don't know how to include this token in IMAP requests. I use htt开发者_运维百科p://php.net/manual/en/book.imap.php library to access IMAP. Seems this PHP extension doesn't allow to use some alternate AUTHENTICATE methods. Is this possible to use XOAUTH with this IMAP extension?
If no then what can i do there? Is it possible to create some alternate function for imap_open that will return some handle taht later can be used with all another functions of this extension?
Standard PHP extension doesn't support XOAUTH. handmadeimap library, however, might be useful - it has example of doing oauth authentication against Google.
As a lot of people will hit this question. So Using php_sockets Implemented a simple library. Hopefully will act as required. Delete mail function is not yet added. But you can take a look if it satisfies your need. Try example. https://github.com/vmuthal/VivOAuthIMAP
精彩评论