Missing private key throws exception

Created on 4 January 2023, over 1 year ago
Updated 21 January 2023, over 1 year ago

Problem/Motivation

I recently set up a dev environment on a new workstation, and did not get my private key copied into the location specified in the SP settings form. This dumps an error to the browser:

OneLogin\Saml2\Error: Invalid array settings: sp_certs_not_found_and_required in OneLogin\Saml2\Settings->__construct() (line 141 of /app/vendor/onelogin/php-saml/src/Saml2/Settings.php.

Steps to reproduce

After saving the settings form, move your cert or private key out of the location specified.

Proposed resolution

Attached MR presents a friendlier message (“Configuration error: login is unavailable.”) to the user and redirects them to <front>. It logs the actual exception.

Remaining tasks

Possibly add a check to the “Status report” page by implementing hook_requirements()? I doubt this happens with enough frequency to make that worthwhile, though we could also consider adding a warning for the cert expiring soon (or an error that it has expired).

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇺🇸United States jproctor

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024