Authenticated users receive 403 (Access Denied) when visiting /saml_login

Created on 6 January 2023, over 2 years ago
Updated 19 April 2024, 12 months ago

Problem/Motivation

If a user who has successfully authenticated subsequently visits the /saml_login route, they will be sent to the site's 403 page.

Although there is no reason that authenticated users *need* to navigate to the URL, our customers have reported that users do so, perhaps because they have bookmarked that as their 'landing page' for the site.

This behavior of the 403 contrasts with the behavior of core Drupal behavior, where if an authenticated user navigates to /user/login, they will be redirected to their /user/[id] route.

Steps to reproduce

1. Sign in with SAML.
2. Navigate to /saml_login.
3. You will see a 403 response.

Proposed resolution

Match the behavior of Drupal core by redirecting authenticated users who visit /saml_login to their /user/[id] route.

diff --git a/simplesamlphp_auth.routing.yml b/simplesamlphp_auth.routing.yml
index 5fe63b3..3042ed6 100644
--- a/simplesamlphp_auth.routing.yml
+++ b/simplesamlphp_auth.routing.yml
@@ -24,7 +24,7 @@ simplesamlphp_auth.saml_login:
   defaults:
     _controller: '\Drupal\simplesamlphp_auth\Controller\SimplesamlphpAuthController::authenticate'
   requirements:
-    _user_is_logged_in: 'FALSE'
+    _access: 'TRUE'
   options:
     _maintenance_access: TRUE
     no_cache: TRUE
πŸ› Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Pipeline finished with Failed
    about 1 year ago
    Total: 142s
    #94549
  • Status changed to Needs work 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States brooke_heaton
  • Pipeline finished with Failed
    12 months ago
    Total: 173s
    #151380
  • Pipeline finished with Failed
    12 months ago
    #151407
  • Pipeline finished with Failed
    12 months ago
    Total: 144s
    #154622
  • Pipeline finished with Failed
    12 months ago
    Total: 139s
    #154628
  • Pipeline finished with Canceled
    12 months ago
    Total: 28s
    #154716
  • Pipeline finished with Running
    12 months ago
    #154717
  • Pipeline finished with Failed
    12 months ago
    Total: 205s
    #154736
  • Pipeline finished with Failed
    12 months ago
    Total: 197s
    #154777
  • Pipeline finished with Failed
    12 months ago
    Total: 233s
    #154779
  • Pipeline finished with Failed
    12 months ago
    Total: 142s
    #154786
Production build 0.71.5 2024