-
Notifications
You must be signed in to change notification settings - Fork 46
[BUGS-10105] Fix SimpleSAMLphp 2.x Auto-Detection #452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
inc/class-wp-saml-auth-cli.php
Outdated
| // 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // 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)
There was a problem hiding this comment.
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.
|
Hi from your friendly robot! 🤖 I fixed PHPCS issues with |
* 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]>
* 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]>
* 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]>
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.