【问题标题】:Followed The Google OmniAuth tutorial but getting rejected from Server, how to read the rejection notice遵循 Google OmniAuth 教程但被服务器拒绝,如何阅读拒绝通知
【发布时间】:2011-12-02 04:50:30
【问题描述】:

这是我遵循的教程。向下滚动到 Google open-id 集成:

https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

在服务器上,单击使用 google 链接登录后,我收到以下拒绝消息:

WARNING: making https request to https://www.google.com/accounts/o8/id without verifying server certificate; no CA path was specified.
processing by users omniauthcallbackscontroller failure as html

编辑以下两行修复了 CA 路径警告,但没有做任何事情来修复失败作为 html 问题或让我前进

require "openid/fetchers"
OpenID.fetcher.ca_file = "/etc/ssl/certs/ca-certificates.crt"

然后它会将我重新路由到 users/sign_in。

我的设计配置行如下所示:

config.omniauth :open_id, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/acounts/o8/id', :require => 'omniauth-openid'

我的研究告诉我,我可能正在访问 openID 服务器,但我被拒绝了。有没有办法从某种拒绝通知中获得更多信息?我的请求可能有什么问题?

我想到的一件事是开放 ID 的凭据,但我在教程中没有看到我应该获取或输入任何凭据的任何地方。

【问题讨论】:

    标签: ruby-on-rails-3 devise omniauth


    【解决方案1】:

    尝试指定ca_path:

    config.omniauth :open_id, :store => OpenID::Store::Filesystem.new('/tmp'), 
                    :name => 'google', 
                    :identifier => 'https://www.google.com/acounts/o8/id', 
                    :require => 'omniauth-openid', 
                    :client_options => {:ssl => {:ca_path => '/etc/ssl/certs'}}
    

    然后看看它是否有效。

    【讨论】:

    • 这似乎对结果没有影响。您是否知道谷歌是否会发回任何消息来解释他们拒绝请求的原因?
    • 添加以下 2 行删除了 CA 警告,但没有解决 HTML 问题。要求 "openid/fetchers" OpenID.fetcher.ca_file = "/etc/ssl/certs/ca-certificates.crt"
    猜你喜欢
    • 2010-12-25
    • 2015-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多