OAuth2::LinkedIn 錯誤 (OAuth2::Error with LinkedIn)


問題描述

OAuth2::LinkedIn 錯誤 (OAuth2::Error with LinkedIn)

我正在使用 Rails 和 OAuth,因此用戶可以使用 LinkedIn 登錄。我正在關注本教程 http://www.sitepoint.com/ rails‑authentication‑oauth‑2‑0‑omniauth/。我在 LinkedIn Developers 上註冊了我的應用程序並按照 T 的說明進行操作。但是,當使用 localhost 測試應用程序並導航到 LinkedIn 授權頁面時,我收到此 Action Controller 錯誤消息作為回調:

OAuth2::Error

invalid_request:缺少必需參數,包含無效參數值,參數不止一次。: 無法檢索訪問令牌 : appId 或重定向 uri 與授權碼不匹配或授權碼已過期 {" error_description":"缺少必填參數,包含無效參數值,參數不止一次。: 無法檢索訪問令牌 : appId 或重定向 uri 與授權碼不匹配或授權碼已過期","error":"invalid_request"}

我該怎麼做才能解決這個問題,所以使用 LinkedIn 的 OAuth 有效嗎?這是我在 omniauth.rb 中的代碼


參考解法

方法 1:

You can not set localhost directly as your callback. You can use 127.0.0.1:3000 instead of localhost to get it working.

(by user5384877Haider)

參考文件

  1. OAuth2::Error with LinkedIn (CC BY‑SA 2.5/3.0/4.0)

#linkedin #oauth-2.0 #OAuth #ruby-on-rails






相關問題

php中需要LinkedIn類型的朋友連接 (LinkedIn type friends connection required in php)

我可以在沒有明確用戶批准的情況下獲得 Linkedin oauth 訪問令牌嗎? (Could I get Linkedin oauth access token without explicitly user approve?)

Rails 3 Linkedin API 寶石 (Rails 3 Linkedin API gem)

如何在 iOS SDK 中獲取 LinkedIn 連接/朋友/聯繫人? (How to fetch LinkedIn connections/Friends/Contacts in iOS SDK?)

Linkedin 應用程序具有 OAuth 用戶令牌和 OAuth 用戶密鑰,它們會過期嗎? (Linkedin Application has OAuth User Token and OAuth User Secret, Do they Expire?)

LinkedIn 獲取個人資料提要或新聞提要 2015 (LinkedIn get profile feed or news feed 2015)

OAuth2::LinkedIn 錯誤 (OAuth2::Error with LinkedIn)

如果 Android 中未安裝 LinkedIn 本機應用程序,如何使用 LinkedIn 登錄和發布? (How to login and post with LinkedIn if LinkedIn native app is not installed in android?)

使用 JS API 集成 LinkedIn 登錄 (Integrate LinkedIn login using JS API)

Linkedin oauth2 r_liteprofile 沒有從 api 返回 (Linkedin oauth2 r_liteprofile not being returned from api)

LinkedIn OAuth2.0 使會話無效/強制重新授權 (LinkedIn OAuth2.0 Invalidate Session / Force re-authorization)

LinkedIn API v2 獲取用戶信息 (LinkedIn API v2 get user info)







留言討論