Problem/Motivation

A user trying to log in in a drupal site via CAS with the same e-mail that one previously existing will cause new user created with a duplicated email. You can subscribe to module events to try to avoid that but is not possible to customize the message.

Steps to reproduce

  1. Configure CAS with the flag "auto_register".
  2. Create a new drupal user, with mail "example@example.com".
  3. Configure a CAS server, add user to the CAS with mail "example@example.com"
  4. Try to log in the user via CAS in the drupal site. This will create a new user in the drupal site and will have the example@example.com email, the same that the one created manually.

.

Proposed resolution

Modify CasPreRegisterEvent events to improve this workflow and allow the customization of the cancelation of a user registration.

Issue fork cas-3221111

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

escuriola created an issue. See original summary.

escuriola’s picture

Issue summary: View changes

abelcain made their first commit to this issue’s fork.

claudiu.cristea’s picture

Status: Active » Needs work

Needs work, see the MR

bkosborne’s picture

This is a nice feature, thank you all.

I'll set a reminder to review this more thoroughly myself soon.

After speaking with Claudiu in Slack, the deprecation notice should be against 2.x and will be removed in 3.x, and this feature should be rebased against the 2.x branch instead of 8.x-1.x.

I updated the default repo branch to 2.x to help avoid future contributions from using the older branch, sorry about that.

claudiu.cristea’s picture

As per #7, I've rebased the MR on top of 2.x branch.

claudiu.cristea’s picture

Version: 8.x-1.x-dev » 2.x-dev
Status: Needs work » Reviewed & tested by the community

Thank you for working on this. RTBC.

claudiu.cristea’s picture

However, it's strange that I cannot see the tests on the latest commits. Maybe because we've changed the branch?

claudiu.cristea’s picture

Assigned: escuriola » Unassigned

Unassigning.

claudiu.cristea’s picture

Changing adding EC to my contrib attribution.

bkosborne’s picture

Reviewed again, and manually tested, and it works great. Thank you everyone!!

bkosborne’s picture

Status: Reviewed & tested by the community » Fixed
escuriola’s picture

Fixing credit attribution

abelcain’s picture

Fixing credit attribution.

Status: Fixed » Closed (fixed)

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

chewie’s picture

StatusFileSize
new27.35 KB

Standalone patch for safe use of these changes with ^1.7 version.

chewie’s picture

StatusFileSize
new12.89 KB

'.diff' version of patch from comment #19.