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


問題描述

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

我剛剛在我的應用程序中從 LinkedIn 的 JavaScript SDK 遷移到他們的 OAuth2.0 授權流程,因為他們在 3 月份宣布棄用他們的 SDK。

身份驗證流程按預期工作。問題是我找不到任何有關如何強制重新身份驗證或使當前用戶的訪問令牌無效的文檔。以前的 JavaScript SDK 有一個 IN.User.logout() 方法,我用來允許重新認證,而這在使用 OAuth2.0 流程時是不可用的。這會給在共享計算機/瀏覽器上登錄的用戶帶來問題。

以下是我發現重新身份驗證在哪裡啟動的一些方法,但我的應用程序無法自行完成:

  • 清除網絡瀏覽器/LinkedIn cookie
  • 直接註銷 LinkedIn 網站
  • 更新/更改請求的權限(不理想)

有沒有人建議我如何強制重新應用程序中的身份驗證?或者這是不可能的,除非 LinkedIn 實現了一個端點來使令牌無效?

希望 LinkedIn 的某個人可能能夠對此進行干預,以及他們希望開發人員如何處理這種情況,因為他們指向 Stack Overflow 尋求支持.

參考資料

更新 [2/12/19]:我已經就這個問題直接聯繫了 LinkedIn,他們繼續將我引導到這裡並堅持讓我重新發布這個問題。希望LinkedIn的人仍然會看到這個,但假設它不會很快得到答复。必須假設 v2 API 中不存在失效。


參考解法

方法 1:

I had same suffering as you, so I started with all possible combinations of requests until I managed to revoke token, this is the request:

curl ‑‑request POST \
  ‑‑url https://www.linkedin.com/oauth/v2/revoke \
  ‑‑header 'Content‑Type: application/x‑www‑form‑urlencoded' \
  ‑‑data client_id=CLIENT_ID_HERE \
  ‑‑data client_secret=CLIENT_SECRET_HERE \
  ‑‑data token=YOUR_TOKEN_HERE

(by jalamakSrđan Radiša)

參考文件

  1. LinkedIn OAuth2.0 Invalidate Session / Force re‑authorization (CC BY‑SA 2.5/3.0/4.0)

#linkedin #oauth-2.0 #linkedin-api






相關問題

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)







留言討論