Problem/Motivation

When some module alter route for user login. Basic auth return with 404 exception.

Steps to reproduce

  • Install module Rename Admin Paths
  • Rename user login path from '/user/login' to '/member/login'.
  • Enable 'Physical file' in import config.
  • Try to import entity with files will throw 404 /user/login not found.

Proposed resolution

Get Login URI from route in Basic auth.

Remaining tasks

Remove hard coded URI from Basic auth.

User interface changes

NA

API changes

NA

Data model changes

NA

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

Bunty Badgujar created an issue. See original summary.

bunty badgujar’s picture

Assigned: bunty badgujar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new988 bytes

Use Url::fromRoute() instead of hard code URL.

Status: Needs review » Needs work

The last submitted patch, 2: respect-route-alter-in-basic-auth-3215582-2.patch, failed testing. View results

grimreaper’s picture

Title: Respect route alter in basic auth » Support non standard login URL
Category: Bug report » Feature request

Hello,

I understand your problem but you can't use this approach to fix it because when you are doing Url::FromRoute, it gives you the login URL of the client website and not the login URL of the server website.

It would work only if both server and client websites have the login URL altered the same way.

A much more flexible solution would be to add a new attribute into the Remote config entity to store the login URL path so it can be configurable per remote website.

grimreaper’s picture

Status: Needs work » Active

Back to "active" as the approach in the MR is not ok.

grimreaper’s picture

Component: Code » Entity share client
grimreaper’s picture

Assigned: Unassigned » grimreaper

grimreaper’s picture

Status: Active » Needs work

Need to write dedicated tests with rename_admin_paths.

Also this feature will have to wait for a 4.0.x branch due to interface change.

grimreaper’s picture

Title: Support non standard login URL » [4.0.x] Support non standard login URL
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Postponed

Issue and change record (https://www.drupal.org/node/3248639) ready for 4.0.x.

grimreaper’s picture

Title: [4.0.x] Support non standard login URL » Support non standard login URL
Version: 8.x-3.x-dev » 4.0.x-dev
Component: Entity share client » Code
Assigned: Unassigned » grimreaper
Status: Postponed » Active
grimreaper’s picture

Normally the tests on D10 will fail because rename_admin_path currently does not have a D10 compatible release. And so it will prevent merging this feature.

grimreaper’s picture

So it seems that Drupal CI is able to take the dev branch of rename_admin_paths automatically for D10 compatibility.

https://dispatcher.drupalci.org/job/drupal8_contrib_patches/150471/console:

11:53:12   - Installing drupal/rename_admin_paths (dev-2.x e2a72be): Cloning e2a72bec8b from cache

  • Grimreaper committed 94d69219 on 4.0.x
    Issue #3215582 by Grimreaper, Bunty Badgujar: Support non standard login...
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

kmani’s picture

The above patch is failing for version 3.13 and update the new patch for it