Skip to content

Conversation

@AnaisPantheor
Copy link
Contributor

@AnaisPantheor AnaisPantheor commented Dec 30, 2025

Customers using SimpleSAMLphp 2.x (especially via Composer) experienced "Invalid provider specified for SAML authentication" errors after upgrading from v2.1.4 to v2.2.0. The plugin's autoloader search only checked for SimpleSAMLphp v1.x paths (lib/_autoload.php) in default locations, missing v2.x installations that use vendor/autoload.php.

inc/class-wp-saml-auth.php

Added Composer vendor path to default search paths (line 541):
- Added ABSPATH . 'vendor/simplesamlphp/simplesamlphp' to the default search array
- Enables automatic detection of Composer installations without manual configuration

Enhanced autoloader detection to support both v1.x and v2.x (lines 548-558):
- For each base path, now checks vendor/autoload.php (v2.x) first
- Falls back to lib/_autoload.php (v1.x) if v2.x autoloader not found
- Maintains backward compatibility with existing v1.x installations

inc/class-wp-saml-auth-cli.php
Updated WP-CLI scaffold defaults (lines 94-96):
The scaffold_config_function() method generates example configuration code when users run wp saml-auth scaffold-config.
The old code was outdated, implied manual configuration, and only showed the SimpleSAMLphp v1.x path (lib/_autoload.php), not the v2.x support.
Now it indicates that auto-detection works and that you only need to set this for non-standard locations.

Comment on lines 94 to 96
// SimpleSAMLphp autoloader path is auto-detected. Only set if using a non-standard location.
// 'simplesamlphp_autoload' => __DIR__ . '/simplesamlphp/vendor/autoload.php', // v2.x.
// 'simplesamlphp_autoload' => __DIR__ . '/simplesamlphp/lib/_autoload.php', // v1.x.
Copy link
Member

@pwtyler pwtyler Jan 5, 2026

Choose a reason for hiding this comment

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

Suggested change
// SimpleSAMLphp autoloader path is auto-detected. Only set if using a non-standard location.
// 'simplesamlphp_autoload' => __DIR__ . '/simplesamlphp/vendor/autoload.php', // v2.x.
// 'simplesamlphp_autoload' => __DIR__ . '/simplesamlphp/lib/_autoload.php', // v1.x.

This is called out in the docs to add if needed, no need to have commented out, I think. (although perhaps add a 'simplesamlphp_autoload' => '...' suggestion line there)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, it's for a specific scenario that users would have to check the documentation for. Code updated.

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Hi from your friendly robot! 🤖 I fixed PHPCS issues with phpcbf on d15507e. Please review the changes.

@AnaisPantheor AnaisPantheor merged commit de94b98 into develop Jan 7, 2026
7 checks passed
@AnaisPantheor AnaisPantheor deleted the vendorSSP branch January 7, 2026 19:32
AnaisPantheor added a commit that referenced this pull request Jan 8, 2026
* Adds vendor path for composer ssp install
* Update the cli command for config path
* Update documentation for SSP composer install 1.x and 2.x versions

---------

Co-authored-by: Pantheon Robot <[email protected]>
AnaisPantheor added a commit that referenced this pull request Jan 8, 2026
* Adds vendor path for composer ssp install
* Update the cli command for config path
* Update documentation for SSP composer install 1.x and 2.x versions

---------

Co-authored-by: Pantheon Robot <[email protected]>
AnaisPantheor added a commit that referenced this pull request Jan 9, 2026
* Adds vendor path for composer ssp install
* Update the cli command for config path
* Update documentation for SSP composer install 1.x and 2.x versions

---------

Co-authored-by: Pantheon Robot <[email protected]>
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.

3 participants