简体   繁体   English

如何通过https从Heroku上托管的Rails应用程序访问Google云端硬盘文档内容?

[英]How to access Google Drive document contents through https from a Rails app hosted on Heroku?

I have a Rails app ( https://github.com/ddelruss/loops ) which I have hosted on Heroku. 我有一个我在Heroku上托管的Rails应用程序( https://github.com/ddelruss/loops )。 It uses a Rails form to collect the user's Google id, password, and document id, which it uses to log in to Google drive, download the document contents, and render as a D3 visualization. 它使用Rails表单来收集用户的Google ID,密码和文档ID,用于登录Google驱动器,下载文档内容以及呈现为D3可视化。 All that works fine - test if you like (and trust the current security): 一切正常 - 测试你是否喜欢(并相信当前的安全性):

http://young-eyrie-4632.herokuapp.com/ http://young-eyrie-4632.herokuapp.com/

You can use the publicly available demo document key: 0AtOGnLq8Mf_ydGtmMmI5UjhEUmlqQ0d6UHFVaWN2TWc 您可以使用公开的演示文档密钥:0AtOGnLq8Mf_ydGtmMmI5UjhEUmlqQ0d6UHFVaWN2TWc

None of the user information is stored, as I want to keep the site as secure as possible. 没有存储任何用户信息,因为我希望尽可能保证网站的安全。 The flaw is that the site is currently accessed at http, which I understand to mean that the user credentials are sent from the web form to Heroku/Rails unencrypted. 缺陷是该网站目前在http访问,我理解这意味着用户凭据从Web表单发送到未加密的Heroku / Rails。

So, I want to access the app through https, which Heroku supports through ssl piggybacking. 所以,我想通过https访问应用程序,Heroku通过ssl捎带支持。 And indeed the site loads with https:// and will render the visualization page. 实际上,网站使用https://加载,并将呈现可视化页面。 The problem is that the Google doc does not return any results. 问题是Google doc不会返回任何结果。 The login succeeds, no application error (according to heroku logs)...just with an empty result. 登录成功,没有应用程序错误(根据heroku日志)...只是一个空的结果。

What can I do to get my app working through https, including getting results from the Google drive document? 我该怎么做才能让我的应用通过https工作,包括从Google云端硬盘文档中获取结果? Note that I don't need both - if https works I'm fine disabling http access. 请注意,我不需要两者 - 如果https工作,我很好禁用http访问。

Thank you, 谢谢,

Damien 达米安

I ran your app with the demo document and the Hierarchy option with both http and https and from looking at the HTML, it appears that the content is present in both cases, but not displayed in the case of https. 我使用演示文档和带有http和https的Hierarchy选项运行您的应用程序,并且通过查看HTML,似乎内容在两种情况下都存在,但在https的情况下不显示。 That is, I believe Google is returning the document properly. 也就是说,我相信Google正在正确归还该文档。

I didn't do a complete comparison of the HTML generated in the two cases, but after a quick glance, it appears that the http://d3js.org/d3.v2.js /script node is not present in the case of https access as it is in the http case. 我没有对这两种情况下生成的HTML进行完整的比较,但是在快速浏览一下后,似乎http://d3js.org/d3.v2.js / script节点不存在于https访问,因为它在http案例中。

Hope this helps. 希望这可以帮助。

Pete 皮特

4/25/13 Update: Looking at my Console output on Chrome, I see the following error: 4/25/13更新:查看我在Chrome上的控制台输出,我看到以下错误:

[blocked] The page at https://young-eyrie-4632.herokuapp.com/loops/nodes ran insecure content from http://mbostock.github.com/d3/d3.js . [已屏蔽] https://young-eyrie-4632.herokuapp.com/loops/nodes上的页面运行了来自http://mbostock.github.com/d3/d3.js的不安全内容。

and I confirmed that this script does not appear under Chrome's "Sources" tab, so I gather it's not getting loaded in the https case. 我确认此脚本没有出现在Chrome的“来源”标签下,所以我收集它并没有加载到https案例中。 I don't know if you can change this to an https reference or whether you're going to have to add it to your repository so that Rails loads it at startup. 我不知道您是否可以将其更改为https引用,或者您是否必须将其添加到存储库以便Rails在启动时加载它。 That still leaves the reference to http://d3js.org/d3.v2.js . 这仍然是对http://d3js.org/d3.v2.js的引用。 I can't figure out where that's coming from. 我无法弄清楚它的来源。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何创建从WordPress(驻留在wsynth上)到Heroku托管的Rails应用的301重定向? - How do I create 301 redirect from WordPress (hosted on wsynth) to a Rails app hosted on Heroku? 在heroku上托管的Rails应用程序表示未安装Google Analytics - Rails app hosted on heroku says Google Analytics is not installed 如何从 Heroku 中托管的 Rails API 应用程序在浏览器中设置 cookie,该应用程序在 Netlify 中托管的 React 应用程序中运行前端? - How can I set cookies in a browser from a Rails API app hosted in Heroku running the frontend in a React app hosted in Netlify? 如何将数据从Google Drive API传递到Rails App模型中? - How To Pass Data From Google Drive API Into Rails App Model? 如何让用户从Rails应用程序将其帖子备份到Google驱动器? - How to let users backup their posts to Google drive from Rails app? 对于Heroku托管的应用,使用HTTP代替https - http instead of https for heroku hosted app 从Heroku Rails应用程序重新路由到AWS托管资产 - Rerouting to AWS hosted assets from a Heroku Rails app 从Heroku上托管的Rails应用发送大量定制电子邮件 - Sending mass, customized emails from a Rails app hosted on Heroku 如何为heroku上托管的Rails应用程序设置QuotaGuard Static? - How to setup QuotaGuard Static for a Rails app hosted on heroku? 如何在Google中使Rails Heroku应用程序内容可搜索? - How to make Rails Heroku Application Contents Searchable in google?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM