简体   繁体   English

通过Google对Heroku应用进行身份验证

[英]Authenticating Heroku app with Google

I'm trying to set up a Rails app on Heroku to access Google data. 我正在尝试在Heroku上设置Rails应用程序以访问Google数据。 I'm new to the process but it looks like I need to register an authentication certificate with Google in order to use Google services (using either OAuth or AuthSub). 我是这个过程的新手,但看起来我需要在Google注册身份验证证书才能使用Google服务(使用OAuth或AuthSub)。 End game: I need persistent access to Google calendar data. 结束游戏:我需要永久访问Google日历数据。

Google's Manage Domain site provides a way to upload an X.509 certificate, but for development purposes I'm just using Heroku's Piggyback SSL to get access to the heroku.com certificate. Google的Manage Domain网站提供了一种上传X.509证书的方法,但是出于开发目的,我只是使用Heroku的Piggyback SSL来访问heroku.com证书。 Assuming I'm on the right path, how do I provide the Heroku certificate to Google so I can continue? 假设我走的路正确,如何向Google提供Heroku证书,以便我可以继续?

It's also quite possible that I've gone down a rabbit hole; 我也很有可能掉进了兔子洞。 if that's the case, any advice re: authenticating Heroku with Google would be much appreciated. 如果真是这样,那么您的任何建议都是值得的:向Google认证Heroku。

You're making it way too hard on yourself. 您对自己太过困难了。 Either use OAuth 1 with the HMAC-SHA1 signature method or use OAuth 2. Preferably OAuth 2, though I'm not sure if that's compatible with the old GData libraries that the current version of the Calendar API uses. 可以将OAuth 1与HMAC-SHA1签名方法一起使用,也可以使用OAuth2。最好是OAuth 2,尽管我不确定这是否与当前版本的Calendar API使用的旧GData库兼容。 But honestly, even if it's not compatible, the advantages of OAuth 2 might make it worth hacking something together. 但老实说,即使不兼容,OAuth 2的优点也可能值得一起破解。 You can use Signet to do OAuth 2 — that's the Google-supported OAuth client for Ruby. 您可以使用Signet来执行OAuth 2,这是Google支持的Ruby OAuth客户端。 Don't use AuthSub unless you've got a really good reason. 除非您有充分的理由,否则请勿使用AuthSub。 There should be no certificates involved at all. 根本不应该涉及任何证书。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM