When external authentication occurs and the user is logged in through user_external_login_register, the user_authenticate_finalize function is not called, but should be (according to it's documentation). This results in hook_user not being called with op=='login'.

The check for blocked users doesn't occur either.
The provided patch calls user_external_login instead of setting the $user global, and thus solves the issues.

CommentFileSizeAuthor
#8 542120-external-login-D6.patch1022 bytesStevel
user.module-D6.diff704 bytesStevel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stevel’s picture

Component: user system » user.module
Damien Tournoud’s picture

Version: 6.x-dev » 7.x-dev

That does make sense. Let's get this fix into D7 (if it is still required, Moshe refactored this part some weeks ago), and think about the backport later on.

anders.fajerson’s picture

The patch should fix another gotcha with the use of this function as well:

Say a user has registered as a normal Drupal user with the username "foobar".

Then an user uses an autenticated module to login, and provides the username (authname) "foobar". In that case the user would be logged in as the normal Drupal user.

Critical? At least a Drupal DX issue.

Update: This has indeed been re-factored. Not sure if it applies any more.

Dave Cohen’s picture

Anyone interested in user_external_login_register in 7.x might also be interested to know that it is completely broken.

http://drupal.org/node/765222

Stevel’s picture

Version: 7.x-dev » 6.x-dev

The behaviour is fixed in D7, so lets think about a backport to D6

Stevel’s picture

Status: Active » Needs review

Guess this has to go to CNR again

Damien Tournoud’s picture

Status: Needs review » Needs work

I'm ok with this patch. Could someone attach a proper patch?

Stevel’s picture

FileSize
1022 bytes

Rerolled the patch from CVS checkout of drupal 6.17

Stevel’s picture

Status: Needs work » Needs review
thedavidmeister’s picture

Status: Needs review » Needs work

patch no longer applies.

error: user/user.module: No such file or directory

Not sure if we're still looking to get this committed.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.