Check Config Value for idp_certs

Created on 20 July 2024, 6 months ago

Problem/Motivation

The SAML Service attempts to loop $certs array. In the case that $certs is not set, there should be a conditional check beforehand, to avoid PHP warning messages.

Steps to reproduce

Execute SAML requests.

Proposed resolution

Apply check for if ((isset($certs)) && (!empty($certs))) {

πŸ› Bug report
Status

Active

Version

3.9

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Shefik

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

Comments & Activities

  • Issue created by @Shefik
  • πŸ‡ΊπŸ‡ΈUnited States Shefik

    Applied patch to resolve the issue.

  • πŸ‡ΊπŸ‡ΈUnited States Shefik

    Updated patch for samlauth 8.x-3.10.

  • Status changed to Closed: works as designed 28 days ago
  • πŸ‡³πŸ‡±Netherlands roderik Amsterdam,NL / Budapest,HU

    In the case that $certs is not set, there should be a conditional check beforehand, to avoid PHP warning messages.

    I don't think so: $certs can never be "not set"; if the config value is not set, $certs becomes an empty array. See the line just above what you patched:

    $certs = $config->get('idp_certs') ?? [];
    

    It could be that in your case, the 'idp_certs' value is set to an empty string or other empty scalar value.

    But that really is a misconfiguration on your side. 'idp_certs' has never been a scalar value. And especially now that we have config validation, we can expect this to be a valid value. Besides, it's only a PHP warning, not a fatal error.

    So the solution is just to fix your configuration values.

Production build 0.71.5 2024