小编Ilo*_*tev的帖子

设计Omniauth + Linkedin错误."未找到.身份验证passthru"

我完全按照http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/#changes中的说明进行操作

要在我的应用程序中实现Devise Omniauth Linkedin,我做了以下工作,

在devise.rb中

config.omniauth :linked_in, "*******", "**********"
Run Code Online (Sandbox Code Playgroud)

在我的用户模型user.rb中,我有这个

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :lockable, :confirmable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
     :recoverable, :rememberable, :trackable, :validatable, :confirmable, :omniauthable

TEMP_EMAIL_PREFIX = 'change@me'
TEMP_EMAIL_REGEX = /\Achange@me/
validates_format_of :email, :without => TEMP_EMAIL_REGEX, on: :update

def self.find_for_oauth(auth, signed_in_resource = nil)

# Get the identity and user if they exist
identity = Identity.find_for_oauth(auth)

# If a signed_in_resource is provided it always overrides …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails linkedin devise omniauth

5
推荐指数
1
解决办法
3336
查看次数

标签 统计

devise ×1

linkedin ×1

omniauth ×1

ruby-on-rails ×1