前言介紹
- 這款 WordPress 外掛「Datawiza Proxy Auth Plugin – SSO」是 2020-12-18 上架。
- 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
- 上一次更新是 2021-10-25,距離現在已有 1287 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0.1 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
- 有 1 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
datawiza |
外掛標籤
sso | auth | oidc | SAML | proxy |
內容簡介
此外掛 Proxy Auth Plugin 可以幫助開發者、DevOps 和管理員透過使用反向代理所提供的 JSON Web Token (JWT) 簡單實作 WordPress 的驗證與授權功能。
這可用於透過識別感知代理 (Identity-Aware Proxy) (例如 Datawiza Access Broker 及 Google IAP) 實現 SSO (OAUTH/OIDC、SAML) 至雲端身份提供者 (例如 Azure Active Directory、Okta、Auth0)。
注意,此外掛需要反向代理位於 WordPress 網站前方。反向代理執行驗證,然後透過 HTTP 標頭傳遞使用者名稱和角色的 JWT 給此外掛,標頭名稱為 DW-TOKEN。
透過 Datawiza Access Broker,您可使用基於配置的無程式碼 (no-code) 解決方案,按照此處提供的詳細說明。
如果您決定使用自己的反向代理,請遵循以下說明。
使用方式:
1. 此外掛檢索 JWT 中的使用者 ID (電子郵件),然後檢查此類使用者是否存在。如果不存在,此外掛會使用此電子郵件創建新使用者並簽入。
2. 此外掛檢索 JWT 中的使用者角色,並將其設置為 WordPress 中的使用者角色。
3. 此外掛期望 JWT 包括使用者 ID 和角色作為 HTTP 標頭 DW-TOKEN。例如,JWT 的有效負載可能如下所示:
{
"role": "administrator",
"email": "[email protected]"
}
WordPress 中的外掛設定:
在「設定」-「Datawiza Proxy Auth」中,您需要輸入一個私密密鑰,用作加解密金鑰。該密鑰是插件與反向代理之間共享的。JWT 的簽署算法為 HS256。
注意事項:
1. 如果啟用的 Proxy Auth Plugin 無法檢索到 HTTP 標頭中預期的 JWT,則插件將無法運作,WordPress 將使用預設驗證,並在網頁頂部顯示錯誤橫幅。
2. 請確保客戶端無法繞過反向代理。這可防止人們直接向 WordPress 發送伪造的惡意請求,其中包含任意的 JWT。
3. 建議 WordPress 網站前方的反向代理擦除傳入 HTTP 請求的 DW-TOKEN 標頭。DW-TOKEN 標頭應僅由反向代理生成。
4. 如果管理員未向使用者分派角色,使用者的角色將默認為 WordPress 的訂閱者。
5. 如果 JWT 更新了使用者角色,此外掛將相應地更新 WordPress 中的角色。
生成此外掛所需的 JWT:
如果您使用 openresty/lua-nginx-module,下面是生成外掛所需的 JWT 的程式碼示例:
jwt = require("resty.jwt")
local jwt_token = jwt:sign(
"jwt_secret",
{
header={typ="JWT", alg="HS256"},
payload={email="[email protected]", role="administrator"}
}
)
ngx.req.set_header('DW-TOKEN', jwt_token)
上述 jwt_secret 應為「設定」-「Datawiza Proxy Auth」中輸入的相同私密密鑰。
原文外掛簡介
The Proxy Auth Plugin helps developers/DevOps/admins easily implement authentication and authorization for WordPress by using a JWT (JSON Web Token) provided by a reverse proxy.
This could be employed to achieve SSO (OAUTH/OIDC and SAML) to a Cloud Identity Provider (e.g., Azure Active Directory, Okta, Auth0) by using an Identity-Aware Proxy, e.g., Datawiza Access Broker and Google IAP.
Note that the plugin requires a reverse proxy sitting in front of the WordPress site. The reverse proxy performs authentication, and passes the user name and role in a JWT to the plugin via a HTTP header called DW-TOKEN.
By using Datawiza Access Broker, you get a configuration-based no-code solution, following the detail instruction here.
If you decide to use your own reverse proxy, please follow the instructions below.
How it works
The plugin retrieves the user id (email) from the JWT and then checks if such a user exists. If not, the plugin creates a new user by using this email and signs him/her in.
The plugin retrieves the user role from the JWT and sets it as the user’s role in WordPress.
The plugin expects the JWT including user id and role as a HTTP header DW-TOKEN. For example, the payload of JWT may look like:
{
“role”: “administrator”,
“email”: “[email protected]”
}
Plugin config in WordPress
In Setting -> Datawiza Proxy Auth, you need to input a private secret which is used as a Cryptography Key. Such secret is shared between the plugin and the reverse proxy which is responsible for passing the JWT to the plugin. The Signing Algorithm for the JWT is HS256.
!!! NOTES !!!
If the enabled Proxy Auth Plugin cannot retrieve the expected JWT in the HTTP header, the plugin will not work. The authentication will use the default authentication of wordpress and you will see an error banner on top of the wordpress pages.
MAKE SURE that clients cannot bypass the reverse proxy. This is to prevent people from sending forged malicious requests with arbitrary JWTs directly to WordPress.
It’s recommended that the reverse proxy in front of the WordPress site erases the incoming http request’s DW-TOKEN header. The DW-TOKEN header should be generated by the reverse proxy only.
If admin doesn’t assign role to the user, user’s role will be subscriber for WordPress by default.
If user’s role has been updated in JWT, the plugin will update the role in WordPress accordingly.
Generate the JWT required by the plugin
If you are using openresty/lua-nginx-module, here is the code sample to generate the JWT required by the plugin:
jwt = require("resty.jwt")
local jwt_token = jwt:sign(
"jwt_secret",
{
header={typ="JWT", alg="HS256"},
payload={email="[email protected]", role="administrator"}
})
ngx.req.set_header('DW-TOKEN', jwt_token)
The jwt_secret above should be the same private secret input in Setting -> Datawiza Proxy Auth. The role in payload is optional. If it’s not specified, the default role is subscriber. For more details about lua-resty-jwt, you can visit here.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Datawiza Proxy Auth Plugin – SSO」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.1.0 | 1.1.1 | 1.1.2 | trunk |
延伸相關外掛(你可能也想知道)
WordPress + Microsoft Office 365 / Azure AD | LOGIN 》r WordPress plugins and themes, using the WPO365 | REST API plugin , Customize the login experience with your own logo and message, and create you...。
SAML Single Sign On – SSO Login 》WordPress Single Sign On (WordPress SSO) 是一個外掛程式,可以與我們的 SAML Single Sign On - SSO Login 外掛程式一起使用,實現與 Azure AD、Azure AD B...。
Login for Google Apps 》Google應用登錄允許現有的WordPress使用者使用Google進行帳戶驗證來登錄您的網站以實現安全認證。這意味著,如果他們已經登入Gmail,他們可以通過WordPress登...。
OneLogin SAML SSO 》這個 SAML 外掛可消除密碼,允許您驗證 WordPress 使用者(通常是編輯人員)與現有的 Active Directory 或 LDAP 伺服器進行身分驗證,同時使用 OneLogin、Yub...。
OAuth Single Sign On – SSO (OAuth Client) 》使用 WordPress SSO(單一登入)與 OAuth 和 OpenID Connect 插件,無限制地與以下提供者進行登錄和 SSO:Azure AD、Azure B2C、Office 365、AWS Cognito、Cl...。
Log in with Google 》這是一個極簡化的外掛,讓您的使用者可以使用他們的 Google 帳戶登入 WordPress 應用程式,不再需要記住笨重的密碼!, 初始設置, , , 如果尚未存在,請從 Goo...。
Next Active Directory Integration 》Next Active Directory Integration 可以讓 WordPress 對接 Microsoft Active Directory 進行用戶身份驗證、授權、創建和更新。NADI 是其前身 Active Directo...。
WP Discourse 》WP Discourse 外掛作為 WordPress 網站與 Discourse 社群之間的介面。, 使用 Discourse 作為留言系統:, , 當新的博客文章發佈時,自動建立一個論壇主題以供...。
Login using WordPress Users ( WP as SAML IDP ) 》使用 WordPress 用戶登錄 SAML ( WP as SAML IDP ) 提供 SAML 功能,讓 WordPress 用戶可以使用 WP 用戶認證登錄到符合 SAML/WS-FED/JWT 標準的服務提供方。,...。
Webo-facto 》這個外掛可與您的 WordPress 網站連接至 webo-facto 工作空間,webo-facto 是一個數位活動管理程式,將創建、託管和維護所有網路專案所需工具集成至單一介面...。
Maestro Connector 》作為一個專業的網站開發人員,當你的業務不斷增長時,管理多個用戶和網站可能變得繁瑣。在各個網站之間跟蹤用戶名、密碼、主題、外掛程式、補丁和更新,通常...。
SSO for Azure AD 》這款外掛允許使用者透過 OAuth,使用 Azure AD 帳戶驗證登入網站。, 在 Azure AD 服務入口網站需先註冊應用程式,方可使用這款外掛。, 警告:訪客使用者和使...。
WordPress OpenID Connect Client 》WordPress OpenID Connect (OIDC / openidconnect) 客戶端外掛可讓任何符合 OpenID Connect 1.0 標準的 OpenID Connect 提供者進行單一登入 (SSO)。, 使用此...。
Learnworlds-SSO 》LearnWorlds SSO 外掛程式可以將 WordPress 網站與您的 LearnWorlds 學校連接,實現無縫瀏覽。它會創建帳戶,讓使用者登錄並保持兩個站點的使用者登錄狀態。,...。
IDer Login for WordPress 》透過此外掛程式,您可以使用IDer服務提供登入和註冊程序。, 在一般登入按鈕旁邊,會出現一個額外的「使用IDer登入」按鈕。, 該如何運作?, 1. 首先,您需要在...。