Apply redirect URL after logging out to local authentication

Created on 26 April 2024, 2 months ago

Problem/Motivation

When "Allow authentication with local Drupal accounts" is enabled and "Redirect URL after logging out" is set, the user is not redirected to this path if they are logged in via their local authentication.

The redirect does apply to SAML-authenticated-user logout correctly.

However, the placement of this Redirect URL field in the Local authentication tab makes it seem like it should apply to local authenticated user logouts too.

Steps to reproduce

  1. Enable the Allow authentication with local Drupal accounts at /admin/config/people/simplesamlphp_auth/local.
  2. Set the Redirect URL after logging out value to some valid, internal path.
  3. Save your changes and log out

The user is redirected to the homepage instead of the configured redirect URL.

Proposed resolution

It redirects to the <front> is because Drupal core's logout controller hard-codes the redirect. This behavior clashes with the expected behavior this field represents.

Provide a route alter to override the redirect behavior for local authenticated log-out.

To keep this change backwards compatible, it may be necessary to add a checkbox to optionally perform this override.

✨ Feature request
Status

Closed: works as designed

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jcandan

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

Comments & Activities

  • Issue created by @jcandan
  • Status changed to Closed: works as designed 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States jcandan

    Turns out I was using patch #10 β†’ from #3088028: Impossible to logout with a user authorized to log in the standard way.

    So, I've opted to remove that patch and go with the deactivate-saml-in-lower-environments recommendation from comment #11 in #3088028 β†’ .

    This seems to have fixed my issue.

Production build 0.69.0 2024