[WordPress] 外掛分享: WP SAML Auth

首頁外掛目錄 › WP SAML Auth
WordPress 外掛 WP SAML Auth 的封面圖片
7,000+
安裝啟用
★★★★
4.4/5 分(7 則評價)
9 天前
最後更新
問題解決
WordPress 6.4+ PHP 7.4+ v2.3.1 上架:2016-04-17

內容簡介

WP SAML Auth 外掛提供 WordPress 的 SAML 認證功能,透過 OneLogin 或 SimpleSAMLphp 認證庫,實現安全的用戶登入流程。此外掛簡化了與 Google Apps 的整合,並可自定義認證行為,提升網站安全性與使用者體驗。

【主要功能】
• 支援 SAML 認證,提升安全性
• 整合 Google Apps,簡化登入流程
• 自動創建新用戶,選項可調整
• 支援 SimpleSAMLphp v1.x 和 v2.x
• 提供 WP-CLI 指令,方便管理外掛

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.3.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WP SAML Auth」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

SAML authentication for WordPress, using the bundled OneLogin SAML library or optionally installed SimpleSAMLphp. OneLogin provides a SAML authentication bridge; SimpleSAMLphp provides SAML plus a variety of other authentication mechanisms. This plugin acts as a bridge between WordPress and the authentication library.
If your organization uses Google Apps, integrating Google Apps with WP SAML Auth takes just a few steps.
The standard user flow looks like this:

User can log in via SAML using a button added to the standard WordPress login view.
When the button is clicked, the user is handed off to the authentication library. With OneLogin, the user is redirected to the SAML identity provider. With SimpleSAMLphp, the user is redirected to the SimpleSAMLphp install.
Once the user is authenticated with the identity provider, they’re redirected back to WordPress and signed in to their account. A new WordPress user will be created if none exists (although this behavior can be disabled).
When the user logs out of WordPress, they are also logged out of the identity provider.

A set of configuration options allow you to change the plugin’s default behavior. For instance, permit_wp_login=>false will force all authentication to go through the SAML identity provider, bypassing wp-login.php. Similiarly, auto_provision=>false will disable automatic creation of new WordPress users.
See installation instructions for full configuration details.
Installing SimpleSAMLphp
The plugin supports both SimpleSAMLphp v1.x and v2.x. The autoloader is automatically detected:
SimpleSAMLphp v2.x uses vendor/autoload.php
SimpleSAMLphp v1.x uses lib/_autoload.php
Default Search Paths
The plugin automatically searches for SimpleSAMLphp in these locations:
* ABSPATH . 'simplesaml'
* ABSPATH . 'private/simplesamlphp'
* ABSPATH . 'simplesamlphp'
* ABSPATH . 'vendor/simplesamlphp/simplesamlphp' (Composer installation)
* plugin_dir_path . 'simplesamlphp'
For each path, the plugin checks for both vendor/autoload.php (v2.x) and lib/_autoload.php (v1.x).
This means Composer installations work automatically! If you run composer require simplesamlphp/simplesamlphp in your site root, the plugin will find it without any additional configuration.
Composer Installation (Advanced)
If you install SimpleSAMLphp via Composer to a custom location (not the standard vendor/simplesamlphp/simplesamlphp), you can specify the autoloader path:
add_filter( 'wp_saml_auth_option', function( $value, $option_name ) {
if ( 'simplesamlphp_autoload' === $option_name ) {
// Point to your custom Composer vendor autoloader
return '/custom/path/vendor/autoload.php';
}
return $value;
}, 10, 2 );

Custom Installation Paths
If SimpleSAMLphp is installed in a non-default location, you can set custom search paths with the wp_saml_auth_simplesamlphp_path_array filter:
add_filter( 'wp_saml_auth_simplesamlphp_path_array', function( $simplesamlphp_path_array ) {
// Override default paths with custom paths
return [ '/custom/path/to/simplesamlphp' ];
} );

Or define an explicit autoloader path with the wp_saml_auth_ssp_autoloader filter:
add_filter( 'wp_saml_auth_ssp_autoloader', function( $ssp_autoloader ) {
return ABSPATH . 'path/to/simplesamlphp/vendor/autoload.php';
} );

WP-CLI Commands

This plugin implements a variety of WP-CLI commands. All commands are grouped into the wp saml-auth namespace.
$ wp help saml-auth

NAME

wp saml-auth

DESCRIPTION

Configure and manage the WP SAML Auth plugin.

SYNOPSIS

wp saml-auth

SUBCOMMANDS

scaffold-config Scaffold a configuration filter to customize WP SAML Auth usage.

Use wp help saml-auth to learn more about each command.
Note: The scaffold-config command generates a configuration function with default values. The simplesamlphp_autoload option is not included in the scaffolded output because the plugin auto-detects SimpleSAMLphp installations. Only add this option manually if SimpleSAMLphp is in a non-standard location.
Contributing
See CONTRIBUTING.md for information on contributing.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon