在 CodeIgniter 中实施 Zend Gmail OAuth
我正在尝试使用 Zend Oauth 库在 CodeIgniter 框架中实现一个简单的 Gmail 应用程序(此处)。当然,库存文件工作正常,如果您愿意的话,它的代码是这里(包含的文件common.php只是有我的 oauth 键的变量等)。
但是,我未能成功地将其任何版本移植到 CodeIgniter 框架中。我一直遇到的问题是,一旦我被重定向到 Google 页面以验证对我的 Gmail 帐户的访问权限,它就不会再将我转回到我自己的应用程序。它只是不断刷新 Gmail 批准页面。
我在此处尝试了准系统改编,基本上只是将其复制并粘贴到控制器文件中。
我还尝试与一些数据库功能集成,并将检索访问令牌和访问 gmail 此处分开。
这些都不起作用,只会让我无休止地刷新 Gmail 授予访问页面。
有什么想法吗?
I'm trying to implement a simple Gmail application in a CodeIgniter framework using the Zend Oauth library (here). The stock file works fine, of course, and it's code is here if you want (the included file common.php just has the variables for my oauth keys, etc.).
However, I've been unsuccessful at porting any version of this into the CodeIgniter framework. The problem I keep having is that once I am redirected to the Google page to verify access to my Gmail account, it doesn't ever transfer me back to my own app. It just keeps refreshing the Gmail approval page.
I've tried a barebones adaptation here where I basically just copied and pasted into a controller file.
I've also tried to integrate with some database functionality and to separate retrieving an access token and accessing gmail here.
Neither of these works and just leaves me endlessly refreshing the Gmail grant access page.
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来好像没有设置 OAuth 回调 URL,这解释了为什么您没有被引导回您的应用程序。确保控制器中已加载 URL 帮助器
$this->load->helper('url');
It sounds like the OAuth callback url isn't being set, which explains why you're not being directed back to your application. Make sure you have the URL helper loaded in your controller
$this->load->helper('url');