Needs work
Project:
simpleSAMLphp Authentication
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
31 Jan 2018 at 12:56 UTC
Updated:
15 Aug 2024 at 16:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rickward commentedWe use exactly this method when working with the module. We check the "Allow authentication with local Drupal accounts" and enter 1 in the "Which users should be allowed to login with local accounts?" textfield. This configuration should accommodate your use case.
Comment #3
timwood@rickward, thanks for the input. I realize I didn't provide enough explanation and forgot to include some context. I logged this issue after attempting to use the patch provided in https://www.drupal.org/project/simplesamlphp_auth/issues/2843079.
With the patch provided in that issue, if you uncheck "Allow authentication with local drupal accounts" it conveniently redirects any and all users who attempt to visit /user or /user/login to /saml_login, thus forcing everyone to use SAML. Not only is this a convenience, but also an enforcement mechanism, plus it protects the Drupal user login form from attack, another important control for us.
The complication is that, we'd still like to be able to use `drush uli` to generate one-time login links so Drupal's user #1 may login "locally".
Hopefully this clarifies things.
Comment #4
idebr commentedHi timwood,
rickward posted a configuration that should accommodate your use case in #2. Can you clarify why "Which users should be allowed to login with local accounts?": "1" does not work for you?
Comment #5
timwoodHi idebr,
rickward's suggested configuration (which is what we currently use) allows one-time login links to work, but does not automatically redirect users attempting to access /user or /user/login to /saml_login. I'm suggesting adding logic to the module which would detect a (valid) one-time login link and NOT forward that user to /saml_login.
Comment #6
joelpittet@idebr and @rickward I've the exact same use case as @timwood. I'd like user 1 to be able login with
drush uli/one time login and everybody else login though SAML removing the form.This used to work earlier this year and seems to have stopped.
The only patches I'm using are: #2900442-11: Use Drupal session manager in logout #2748731-12: Don't attempt username sync when user was already matched by username
Comment #7
joelpittetOh also, I tried suggestion as well and it didn't work, the one time login doesn't seem to function.Here's the diff that I tested.
Edit: Ignore this I was having config issues, it does work but ideally the form would always redirect except for one time login
Comment #8
jdleonardI have a slight variation on the OP's use case: due to externally defined security requirements, we need to prevent all users from logging in using a Drupal password, but allow logins via "drush uli" to facilitate logging into test accounts. The problem with the solution proposed thus far is it would allow certain users to login using a Drupal password.
Comment #9
timwoodHi jdleonard,
In your use case, why would the site be using simplesamlphp_auth at all then? Or do you have a mix of SAML and Drupal accounts?
Comment #10
jdleonardWe have SAML accounts, we can't create multiple SAML accounts for an individual due to policies out of our control, and we have Drupal-only accounts that developers need to be able to log in with to test functionality.
Comment #11
idebr commented#5/#6 If I understand correctly, you would like visitors to
/user(or/user/login) to be redirected to/saml_loginbut at the same time have certain accounts or roles be able to log in with one-time login links.Perhaps we can accommodate this use case by splitting up the 'which users/roles can use Drupal accounts' and 'redirect all anonymous users to /saml_login instead of the Drupal login form' to separate configuration options?
Comment #12
dave reidWe needed drush uli to work, but also wanted the user/login path redirected to our provider. It seems like there might need to be configuration for each of these things rather than lumping them together into one checkbox. Here's a temporary patch we needed to allow the drush uli logins to work for us until we can find a more permanent solution here.
Comment #13
nkoporecPatch re-roll, this is still a temporary solution but it does work. Our use-case is also that we don't want users to access /user/login pages but we still want to login via Drush.
Comment #14
robbdavis commentedThis is still an issue. We want all users landing at /user to be redirected to saml login. But we also want
drush ulito work for local environments or test environments where saml is not hooked up.The patch in #13 does work and seems fine for us given that we won't enable 'allow default login'. But it is certainly a hack. It would nice to just have a configuration option to make drush uli work.
Comment #15
sophie.skTagging on support for this.
We'd like all /user paths (/user, /user/login, /user/password) to redirect to Saml, which can be achieved by disallowing local user logins.
However for a subset of users we'd like them to be able to use one-time login links to access the site in the event of an emergency or Saml downtime, therefore need the /user/reset paths to be accessible.
All client users login using Saml, but historically the dev team haven't had SSO accounts set up. They are slowly being rolled out but this is a long process, therefore the dev team needs access via one-time login.
Additionally in the event of an emergency outage the team at the hosting provider (Acquia) need to be able to create and login to an account without going via Saml, therefore need access via one-time login link.
To get around this our current configuration is to allow local logins, and the client has configured a Cloudflare redirect that directs users from /user to the Saml login page. However they've found that adding any query string (eg /user?dfgkjhdflg) prevents that redirect from happening, and that there are extra paths they didn't realise existed!, so we'd really like to leverage the default functionality from this module.
Our ideal configuration/outcome would be:
The patch works, but is definitely a hack. A configuration option, eg "Allow use of one-time login links", would be useful - potentially with allowed roles/user IDs, the same as the default login.