[英]Can't get auth information from Linkedin
我正在使用 LinkedIn 進行身份驗證。 我不知道為什么,但 LinkedIn 不允許突然登錄。 我可以允許 LinkedIn 應用程序,但我無法獲取身份驗證信息。
{"provider"=>"linkedin",
"uid"=>nil,
"info"=>
{"name"=>nil,
"email"=>nil,
"nickname"=>nil,
"first_name"=>nil,
"last_name"=>nil,
"location"=>nil,
"description"=>nil,
"image"=>nil,
"phone"=>nil,
"headline"=>nil,
"industry"=>nil,
"urls"=>{"public_profile"=>nil}},
"credentials"=>{"token"=>"facdxxx-xxx-xxxx-xxxx-xxxxxxxxx", "secret"=>"2xxxxx-xxxx-xxxx-xxxx-xxxxxxx"}}
omniauth_controller.rb
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def linkedin
@user = User.from_omniauth(request.env["omniauth.auth"].except("extra"))
if @user.persisted?
sign_in_and_redirect @user, event: :authentication
else
session["devise.user_attributes"] = @user.attributes
redirect_to new_user_registration_url
end
end
end
我應該更新 LinkedIn 應用程序設置嗎? 我想知道這與 rails 應用程序無關...
文件
gem 'omniauth-linkedin'
我使用omniauth-linkedin
。
當我在二月份注冊時,我獲得了如下許可。
但目前,只有三個。
如何在 LinkedIn 上添加權限?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.