本文介绍了缺少带有Devise和Facebook-Omniauth的client_id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的初始化器/ devise.rb的Facebook代码:

Here is my initializers/devise.rb code for Facebook:

require "omniauth-facebook"
config.omniauth :facebook, "app_key", "app_secret"

我添加了:

devise:omniauthable 进入我想要使用Facebook的模型。

devise :omniauthable into the model I want to be able to use Facebook with.

当我点击此链接时:

<%= link_to "Sign in with Facebook", user_omniauth_authorize_path(:facebook) %>

我得到:

An OAuthException ,其中包含消息:message:缺少client_id参数,

An OAuthException with message: "message": "Missing client_id parameter.",

请注意app_key和app_secret是我可以在我的Facebook应用程序中看到的,但我没有放在这里。

Notice that the app_key and app_secret are the ones that I can see on my Facebook app but I haven't put here.

在点击登录时重定向的URL facebook link我看到client_id参数为空:

On the URL that is redirected when clicking the Sign in with facebook link I see that the client_id parameter is empty:

但是为什么? p>

But why?

推荐答案

我从来没有直接用devise做过。但是这也适用于设计。

I have never done it directly with devise. But this also works well with devise.

或者,如果您仍然想使用devise内置的omiauth,请尝试找到一种方法来提供应用程式ID和应用程式秘密。我很确定你必须在config / initializers /

Alternatively, If you still want to stick with using devise built-in omiauth, try to find a way to provide it the app id and app secret. I'm pretty sure that you have to provide it in devise.rb in config/initializers/

这篇关于缺少带有Devise和Facebook-Omniauth的client_id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 13:29