Add M365 Login plugin: Microsoft Entra ID sign-in for existing users
Adds a WordPress plugin that places a customisable "Sign in with Microsoft" button on wp-login.php and signs existing users in via the OpenID Connect authorization code flow with PKCE. Users are matched by e-mail address only; no accounts are created. Security: single-use state/nonce bound to an HttpOnly cookie, ID token signature verification against Microsoft's JWKS (RS256 only) with issuer/audience/tenant/expiry/nonce checks, optional tenant pinning, account binding to the Microsoft object ID, e-mail domain allow-list, client secret encrypted at rest (AES-256-GCM). Admin: settings screen with connection, button and security tabs, live button preview, colour presets, media-library icon picker, redirect URI copy button and tenant connectivity test. Packaging for WordPress.org: readme.txt with External services section, GPL-2.0 license, uninstall.php, POT + German translations, .distignore, build script, PHPCS config and CI running Plugin Check. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJxAHYdMfKPoN4koRc4Ci2
This commit is contained in:
commit
3e3e87b399
35 changed files with 5413 additions and 0 deletions
35
m365-login.php
Normal file
35
m365-login.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* Plugin Name: M365 Login
|
||||
* Plugin URI: https://github.com/friloo/wp-m365-login
|
||||
* Description: Adds a customisable "Sign in with Microsoft" button to the WordPress login page. Existing users are matched by e-mail address via Microsoft Entra ID (OpenID Connect, PKCE).
|
||||
* Version: 1.0.0
|
||||
* Requires at least: 6.0
|
||||
* Requires PHP: 7.4
|
||||
* Author: friloo
|
||||
* Author URI: https://github.com/friloo
|
||||
* License: GPL-2.0-or-later
|
||||
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
* Text Domain: m365-login
|
||||
* Domain Path: /languages
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
define( 'M365_LOGIN_VERSION', '1.0.0' );
|
||||
define( 'M365_LOGIN_FILE', __FILE__ );
|
||||
define( 'M365_LOGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||
define( 'M365_LOGIN_URL', plugin_dir_url( __FILE__ ) );
|
||||
define( 'M365_LOGIN_OPTION', 'm365_login_settings' );
|
||||
|
||||
require_once M365_LOGIN_DIR . 'includes/class-m365-login-settings.php';
|
||||
require_once M365_LOGIN_DIR . 'includes/class-m365-login-crypto.php';
|
||||
require_once M365_LOGIN_DIR . 'includes/class-m365-login-jwt.php';
|
||||
require_once M365_LOGIN_DIR . 'includes/class-m365-login-auth.php';
|
||||
require_once M365_LOGIN_DIR . 'includes/class-m365-login-button.php';
|
||||
require_once M365_LOGIN_DIR . 'includes/class-m365-login-admin.php';
|
||||
require_once M365_LOGIN_DIR . 'includes/class-m365-login.php';
|
||||
|
||||
register_activation_hook( __FILE__, array( 'M365_Login', 'activate' ) );
|
||||
|
||||
add_action( 'plugins_loaded', array( 'M365_Login', 'instance' ) );
|
||||
Loading…
Add table
Add a link
Reference in a new issue