I am trying to implement google authentication on my site using the google federated login approach http://code.google.com/apis/accounts/docs/OpenID.html#oauth which combines openid and oauth together. I want to use the oa开发者_JAVA百科uth access token generated via the above flow to access the gmail imap using oauth : http://code.google.com/apis/gmail/oauth/protocol.html#imap
This access token doesn't seem to work and I'm unable to fetch mails via imap using this access token. I did set the openid.ext2.scope in the openid request as "https://mail.google.com/" as mentioned in this page: http://sites.google.com/site/oauthgoog/Home/oauthimap
Whereas if I used the plain xoauth implemention : http://code.google.com/p/google-mail-xoauth-tools/wiki/PhpSampleCode it seems to work just fine.
Can I authenticate users using oAuth only and skip openid altogether ? basically my requirements are to : - authenticate the user (and get her firstname, lastname, country, email ect) - Get access to her google contacts and google docs - Get access to google apps mailbox via imap
Any kind of help is appreciated. thanks
This is working now. The access key and access secret returned by google are urlencode and I was using them directly. I just needed to do a urldecode and use them.
精彩评论