Skip to content

Multiple Enhancements, Entra V2 Endpoints, Cert based Auth, Photo Sync. - #282

Open
clarm060 wants to merge 2 commits into
psignoret:masterfrom
clarm060:Add-CertAuth-AddPhotoSync-Upgrade-to-Graph-V2
Open

Multiple Enhancements, Entra V2 Endpoints, Cert based Auth, Photo Sync. #282
clarm060 wants to merge 2 commits into
psignoret:masterfrom
clarm060:Add-CertAuth-AddPhotoSync-Upgrade-to-Graph-V2

Conversation

@clarm060

Copy link
Copy Markdown

Summary of changes
The plugin is now version 0.11.4 and remains branded and attributed to the original author, Philippe Signoret. Authentication improvements
Upgraded authentication to the Microsoft identity platform v2 endpoints. Added authorization-code flow with PKCE.
Added certificate-based client authentication using private_key_jwt. Retained client-secret authentication as an option. Certificate management
Administrators can generate a 3072-bit RSA self-signed certificate from the settings page. The generated public certificate automatically populates the certificate field. Certificate authentication is automatically selected after generation. Added a prominent button to download the public .cer file for uploading to the Entra app registration. The private key is never included in the download or displayed in the administration page. Fixed certificate generation, storage, download routing, settings sanitization, and PEM line-ending issues. Private-key security
The private key is encrypted before database storage using AES-256-CBC. Stored data is integrity-protected with HMAC-SHA-256. Encryption keys are derived from WordPress security keys or an optional dedicated AADSSO_PRIVATE_KEY_ENCRYPTION_KEY. Private-key passphrases are used only during import and are not stored. Profile-photo synchronization
Added Microsoft Graph profile-photo synchronization using /me/photo/$value.

Automatically imports a Microsoft photo during sign-in only when the user has no local photo.

Users can manually replace their photo with the latest Microsoft version from: Their standard WordPress profile.

Uses the existing delegated User.Read access token and does not store Graph tokens.

Existing imported photos continue to work after the old photo-sync plugin is deactivated.

Site-wide photo control
Added an administrator checkbox:
Enable Microsoft Graph profile photo sync
Turning it off:
Stops automatic photo imports.
Stops user-initiated refreshes.
Hides profile synchronization controls.
Does not delete or stop displaying previously imported photos. Compatibility and validation
Added support through PHP 8.5.

Summary of changes
The plugin is now version 0.11.4 and remains branded and attributed to the original author, Philippe Signoret.
Authentication improvements
Upgraded authentication to the Microsoft identity platform v2 endpoints.
Added authorization-code flow with PKCE.
Added certificate-based client authentication using private_key_jwt.
Retained client-secret authentication as an option.
Certificate management
Administrators can generate a 3072-bit RSA self-signed certificate from the settings page.
The generated public certificate automatically populates the certificate field.
Certificate authentication is automatically selected after generation.
Added a prominent button to download the public .cer file for uploading to the Entra app registration.
The private key is never included in the download or displayed in the administration page.
Fixed certificate generation, storage, download routing, settings sanitization, and PEM line-ending issues.
Private-key security
The private key is encrypted before database storage using AES-256-CBC.
Stored data is integrity-protected with HMAC-SHA-256.
Encryption keys are derived from WordPress security keys or an optional dedicated AADSSO_PRIVATE_KEY_ENCRYPTION_KEY.
Private-key passphrases are used only during import and are not stored.
Profile-photo synchronization
Added Microsoft Graph profile-photo synchronization using /me/photo/$value.

Automatically imports a Microsoft photo during sign-in only when the user has no local photo.

Users can manually replace their photo with the latest Microsoft version from:
Their standard WordPress profile.
An owner-only Microsoft Photo Ultimate Member tab.

Uses the existing delegated User.Read access token and does not store Graph tokens.

Preserves compatibility with existing um-graph-photo-sync files and metadata.

Existing imported photos continue to work after the old photo-sync plugin is deactivated.

Site-wide photo control
Added an administrator checkbox:
Enable Microsoft Graph profile photo sync
Turning it off:
Stops automatic photo imports.
Stops user-initiated refreshes.
Hides profile synchronization controls.
Does not delete or stop displaying previously imported photos.
Compatibility and validation
Added support through PHP 8.5.

Removed a PHP 8.5 deprecation warning.

Added smoke tests covering:
Certificate generation, encryption, and signing.
Microsoft v2 authentication flow.
Microsoft Graph profile-photo requests.
Certificate generation and download routing.
PEM newline compatibility.

All plugin PHP files pass linting on PHP 8.5.8.

The final package uses the existing aad-sso-wordpress-master directory so WordPress recognizes it as an in-place update.
@clarm060

Copy link
Copy Markdown
Author

note due to switching to V2 endpoints it does point to different fields in the database, so it will wipe what you have already in there. Im working on fixing that.

Fixed Settings getting wiped out.
@clarm060

Copy link
Copy Markdown
Author

Not in the original commit, but also added the ability to show photo using Ultimate member Membership Plugin natively. It is present in the readme file

@clarm060 clarm060 changed the title upgraded to Graph V2, Support for Cert Auth, and Profile Photo Sync. Multiple Enhancements, Entra V2 Endpoints, Cert based Auth, Photo Sync. Jul 27, 2026

@clarm060 clarm060 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ready to go I tested on a few of my sites and everything seems good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant