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

Issue fork oidc-3500514

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jrockowitz created an issue. See original summary.

matthijs made their first commit to this issue’s fork.

  • matthijs committed 173a0287 on 2.x authored by jrockowitz
    Issue #3500514: OpenID Connect Client returns 'Not Found' for private...
matthijs’s picture

Status: Active » Fixed

Changes have been merged, thanks for your effort.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.