Active
Project:
CAS
Version:
2.x-dev
Component:
CAS
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Mar 2019 at 15:52 UTC
Updated:
2 Mar 2022 at 12:36 UTC
Jump to comment: Most recent
Currently you cannot login if an account with the same username exists within Drupal, but not yet in External Auth. There should be an option to check for this case and use External Auth's linkExistingAccount() function to allow the process to continue
Comments
Comment #2
bkosborneI guess I'm not opposed to adding this as an option, but it just feels pretty dangerous. If you have a local account called "admin" which is user 1, and then your CAS server has some user with "admin" as an ID, then they can login and suddenly become a super admin on your site.
Comment #3
b_sharpe commentedI agree, though if a username form SSO is 'admin' that person likely is an admin. I think two options could mitigate this risk:
If no objections, patch incoming later today likely.
Comment #4
cjokinen commentedI did a backfill using this query
Comment #5
bkosborneb_sharpe, can you provide a real world use case where this would be useful? In my experience, it seems most people come across this when they switch authentication systems from local drupal to CAS, and they need a way to mass-associate the existing Drupal accounts with CAS accounts. If that's your use case as well, I think we'd be better off developing a drush command that this module provides to perform a one-time association, just like the commented in #4 wrote.
Comment #6
bkosborneRe-opening this as a feature request to add this option as a one-time process to perform this "backfill".
Comment #7
bkosborneComment #8
jordan.jamous commentedHi bkosborne, I have a real world use case. I am migrating a sub system from D7 to D9. In my case, I got heap lot of existing users where they've got accounts on the CAS server and the new D9 CAS client, the sub-system wasn't using CAS, so I got to find a way to associate existing Drupal accounts with CAS.
#4 sounds reasonable, thanks.
Comment #9
claudiu.cristeaNew features/fixes should go in
2.x.Comment #10
shakilahmadI updated the 100k+ users with the role CAS in minutes using this query. it's the same as #4 but here I have put a condition to update only the user having CAS role.
INSERT INTO authmap(`provider`, `data`, `uid`, `authname`) SELECT 'cas', 'N;', ufd.uid, ufd.name FROM `users_field_data` ufd JOIN user__roles ur ON (ur.entity_id = ufd.uid) WHERE ur.roles_target_id = 'cas';