gmail oauth imap zend 从 gmail 而不是会话检索
我计划使用 google oauth IMAP 注册我的网站。 我使用 zend 框架也是如此。 http://code.google.com/p/google-mail -xoauth-tools/wiki/PhpSampleCode 我也正在起诉三足方法来注册 当我浏览示例 Threelegged.php 时。 我发现它有电子邮件地址收件箱,他将其保留在会话中并访问 gmail 帐户,一旦他返回,他就会从会话中删除电子邮件 ID
$email_address = $_SESSION['email_address'];
第 121 行
$config = new Zend_Oauth_Config();
$config->setOptions($options);
$config->setToken($accessToken);
$config->setRequestMethod('GET');
$url = 'https://mail.google.com/mail/b/' 。 $电子邮件地址。 '/imap/';
我的要求是我不想在会话中保留电子邮件地址,而是希望在中检索给定的 gmail 地址 $电子邮件地址。 我怎样才能做到这一点? Zend框架中有支持它的函数吗?
Im planning to use google oauth IMAP to sign up for my website.
Im using zend framework for the same.
http://code.google.com/p/google-mail-xoauth-tools/wiki/PhpSampleCode
Also im suing 3 legged approach to sign up
When i go through the sample threelegged.php.
I find that i t has email address inbox and he keeps it in a session and goes to access the gmail account and once he returns back he retireves the email id from the session
$email_address = $_SESSION['email_address'];
Line No.121
$config = new Zend_Oauth_Config();
$config->setOptions($options);
$config->setToken($accessToken);
$config->setRequestMethod('GET');
$url = 'https://mail.google.com/mail/b/' .
$email_address .
'/imap/';
My requirement is i do not want to have email address to be kept in session instead i want the given the gmail address to be retrieved in
$email address.
How can i do that ?
Is any function supporting it in Zend framework?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://sites.google.com/site/oauthgoog/Home/emaildisplayscope
您需要将授权 URL 与您请求获取数据的其他 URL 一起包含在内:
https://www.googleapis.com/auth/userinfo.email
然后当你实际上获取授权令牌,您可以这样做:
这是在验证用于访问数据的令牌之后。然后,该电子邮件地址可用于您的邮件请求或任何需要该电子邮件地址的其他内容。
http://sites.google.com/site/oauthgoog/Home/emaildisplayscope
You will need to include the authorization url with your other urls you are asking permission to get data from:
https://www.googleapis.com/auth/userinfo.email
Then when you actually get the authorized token you can do it like this:
This is after authenticating a token for accessing the data. Then the email address can be used for your mail request or anything else that requires the email address.