OpenID Connect Client returns 'Not Found' for private files created via the Webform module (and other modules).

Created on 17 January 2025, 3 months ago

Problem/Motivation

OpenID Connect Client returns 'Not Found' for private files created via the Webform module (and other modules).

Steps to reproduce

  • Create a plain vanilla Drupal site. ddev drush site-install;
  • Enable private file access. Add $settings['file_private_path'] = 'sites/default/files/private'; to settings.php
  • Install the Webform module ddev composer require 'drupal/webform:^6.3@beta'; ddev drush en -y webform webform_ui;
  • Create a webform with a file upload.
    </code></li>
      <li>Upload a file, goto to the webform's results and confirm you can access the private file.</li>
      <li>Install the oidc module. <code>ddev drush en -y oidc;</cpde></li>
      <li>Confirm that the private file  now returns 'Not Found'</li>
    </ul>
    
    <h3 id="summary-proposed-resolution">Proposed resolution</h3>
    
    The issue is that \Drupal\oidc\EventSubscriber\RequestSubscriber::getRouteMatch is calling <code>$this->requestMatcher->matchRequest($request)

    which sets the 'file' query parameters but does update the request path. When route is finally processed, \Drupal\system\PathProcessor\PathProcessorFiles::processInbound does NOT alter the $path as expected.

    The Redirect module ran into a similar issue via #2985288: Cannot redirect from a private file path β†’ . We should follow their approach and handle specific requests system/files.

    Remaining tasks

    • Replicate the issue
    • Review the patch
    • Write tests if needed
    • Commit the patch

    User interface changes

    N/A

    API changes

    Private files won't be able to redirect users to login.

    Data model changes

    N/A

πŸ› Bug report
Status

Active

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024