簡體   English   中英

使用SSO處理用戶身份驗證

[英]Handling user authentication using SSO

我很難將SSO與Web應用程序集成。

我有一個示例dropwizard應用程序。 我試圖與谷歌和Facebook集成開放連接。

I thought of 2 approaches for integration
1. fetch the token from frontend js once the user is authenticated using open id, pass that token to the dropwizard server as cookie.
2. fetch the token from the dropwizard server itself and store the set token in cookie while responding to the frontend.

我不確定以上2種方法中哪一種最好,或者在dropwizard中是否有建議的與open connect集成的方法?

我喜歡將SSO委派給特定於該工作的知名應用程序/庫。 Keycloak是我熟悉的應用程序。 但是我認為以下幾點與應用程序無關。 這個部分答案是解決方案的可能方向,但如果有這樣的方法,我認為這不是推薦的方法。 有些人會不喜歡這種方法。

前端負責身份驗證。 但是,由於它位於用戶空間中,因此不能信任它未經修改。 因此,應驗證對后端的調用的有效性和授權(無論如何,這應該是后端任務)。

Keycloak具有用於知名前端和后端實現的庫,可輕松集成。 我已經在Angular和Dropwizard中成功使用了它。 與各種身份提供者的集成可以合並。 因此,對於預期身份驗證需求發生變化的情況,這可能是一個非常安全的選擇。 不過,這需要一些時間來適應額外的層,因此您的里程可能會有所不同。

一些鏈接:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM