Comments

slimandslam’s picture

Title: OpenID doesn't quite work with Yahoo! OpenID » OpenID module doesn't quite work with Yahoo! OpenID
webernet’s picture

Status: Active » Closed (won't fix)

The screenshot is of the user/register, not user/login where you'd type your openid info.

slimandslam’s picture

Yes. This is what the user sees when they're returned to Drupal from the Yahoo! flow.

slimandslam’s picture

Status: Closed (won't fix) » Active

The screen capture says "OpenID registration failed". If OpenID registration failed, doesn't that involve the OpenID module? Can you please describe what's going on here? Thanks!

Robin Millette’s picture

The OpenID spec specifies: "If the URL contains a fragment part, it MUST be stripped off together with the fragment delimiter character "#". See Section 11.5.2 (HTTP and HTTPS URL Identifiers) for more information."

cburschka’s picture

So what is the solution? Should the fragment be validated and stripped silently prior to querying yahoo.com?

cburschka’s picture

Title: OpenID module doesn't quite work with Yahoo! OpenID » OpenID module does not allow fragments in identifier URL

This title reflects the root problem more accurately.

slimandslam’s picture

Drupal 6 does not allow ":", "#", or "/" in usernames. How can the URLs often used as OpenID identifiers be
reconciled with that?

Here is the code Drupal 6 users to validate a username:

function user_validate_name($name) {
  if (!strlen($name)) return t('You must enter a username.');
  if (substr($name, 0, 1) == ' ') return t('The username cannot begin with a space.');
  if (substr($name, -1) == ' ') return t('The username cannot end with a space.');
  if (strpos($name, '  ') !== FALSE) return t('The username cannot contain multiple spaces in a row.');
  if (ereg("[^\x80-\xF7 [:alnum:]@_.-]", $name)) return t('The username contains an illegal character.');
  if (preg_match('/[\x{80}-\x{A0}'.          // Non-printable ISO-8859-1 + NBSP
                   '\x{AD}'.                 // Soft-hyphen
                   '\x{2000}-\x{200F}'.      // Various space characters
                   '\x{2028}-\x{202F}'.      // Bidirectional text overrides
                   '\x{205F}-\x{206F}'.      // Various text hinting characters
                   '\x{FEFF}'.               // Byte order mark
                   '\x{FF01}-\x{FF60}'.      // Full-width latin
                   '\x{FFF9}-\x{FFFD}'.      // Replacement characters
                   '\x{0}]/u',               // NULL byte
                   $name)) {
    return t('The username contains an illegal character.');
  }
  if (strpos($name, '@') !== FALSE && !eregi('@([0-9a-z](-?[0-9a-z])*.)+[a-z]{2}([zmuvtg]|fo|me)?$', $name)) ret
urn t('The username is not a valid authentication ID.');
  if (strlen($name) > USERNAME_MAX_LENGTH) return t('The username %name is too long: it must be %max characters
or less.', array('%name' => $name, '%max' => USERNAME_MAX_LENGTH));
}
slimandslam’s picture

It's up to Drupal to help the user select a username that is legal based on Drupal's rules. So, here's some
steps that Drupal can take to help a user in the case where the OpenID identifier is a URL:

If the OpenID URL looks like any of these, Drupal should populate the username box with "foo":

http://foo.domain.com#fragment (eg: http://slimandslam.myopenid.com#dkjladhs )
http://www.domain.com/foo#fragment (eg: http://me.yahoo.com/slimandslam#adsfads)
http://domain.com/whatever/foo#fragment (eg: http://me.yahoo.com/a/slimandslam#aadljh)

cburschka’s picture

Exactly. Stuffing an unfiltered URL into a username field is not good.

scoutbaker’s picture

Marked http://drupal.org/node/219580 as a duplicate.

CompShack’s picture

Thanks ScoutBaker,
you said "an unfiltered URL isn't a valid username. "
So, is this a bug or is it something else that I need to do on my part?
Thanks!

scoutbaker’s picture

@CompShack: I was directly referencing the conversation related to comments 9 and 10 from this issue.

This is a bug. There are numerous discussions and explanations both on drupal.org and other sites explaining how an OpenID is not an account. Authenticating with OpenID needs to relate that ID with a valid account (i.e., user name) on the Drupal site.

cburschka’s picture

Title: OpenID module does not allow fragments in identifier URL » OpenID module tries to create account using URL as username.

I propose this solution:

When authenticating with an OpenID that is not yet known, the site should not try to create an account in the background using the URL as a username, but instead lead to the account creation page in order to create a new account to associate with this OpenID.

Or alternatively, we could allow openid.module to silently create such an account using the username generating function proposed above.

Whether a site allowed "pure" OpenID authentications or required registration of a local account (including email and password) could be a configurable setting, but that is a potential 7.x feature.

CompShack’s picture

you said "but instead lead to the account creation page in order to create a new account to associate with this OpenID."

But this is what is happening already. This could be very confusing to the user that is trying to login using an OPENID as this defetes the purpose of an openid, wouldn't it?

An OpenID is used so that new users don't have to create new username and password, or am I wrong?!

cburschka’s picture

That is why I suggest using a silent username generation method now that cleans the URL for the username and fixes the bug. This would be the default behavior for 7.x-dev; we can consider later on what the site admin can reconfigure about this.

slimandslam’s picture

Is this fixed in the Drupal 6.x-dev version? I'd like to test it asap. I want to make sure this isn't buggy in the Drupal 6 release.

Thanks

webchick’s picture

cburschka’s picture

Nope. After all, no patch was even submitted yet, and I don't know of any duplicate issues that could have solved this. In any case, the account auto-creation still does not work.

I will make a patch that uses _openid_username_from_id($id) to generate the name. For now, I will simply drop non-alphanumeric characters; we can then decide on the exact filtering mechanism to use.

cburschka’s picture

Title: OpenID module tries to create account using URL as username. » OpenID fails to auto-register account: Username invalid, email required
Status: Active » Needs review
StatusFileSize
new1.52 KB

I implemented the following function:

/**
 * Sanitize the openid or the nickname to comply with our own restrictions on a username.
 *
 * @param $id The OpenID URL to sanitize
 *
 * @return $name A valid username for a Drupal account. 
 */

function _openid_username_from_id($id) {
  $tokens = parse_url($id);
  $name = $tokens['host'] . $tokens['path']; 
  $name = trim(preg_replace('/[^a-z0-9]+/', '-', $name), '-');
  return $name;
}

Feel free to suggest a better method for filtering.

Note another aspect to this issue which I just became aware of: Sites that require an email will not be able to accept auto-registration of OpenIDs that do not provide an email address. We either need to document this or provide OpenID with a way to work around this. It certainly is rather confusing now, because after all OpenID is meant to minimalize the hassle of re-registering. Ideally the user should not need to provide any information beside the ID, so requiring an email address is not good.

Edit: Forgot a patch.

catch’s picture

Version: 6.0-rc3 » 7.x-dev

This should probably be fixed in D7 first, then backported. Looks like a sane change to me, but I don't have an OpenID to test it with yet!

slimandslam’s picture

Version: 7.x-dev » 6.0
Priority: Normal » Critical

Let's change the bug settings to reflect the magnitude of this problem. Consider that every Drupal 6 site that goes live with OpenID is going to have egg on its face because people won't be able to use any of the major OpenID providers to login. This is going to cause all Drupal 6 sites to turn off OpenID. It will also contribute to people not using OpenID which defeats its purpose. Drupal 6 makes a big splash with its OpenID support "in the core" but it's broken. Let's quit dilly-dallying around and get this cleaned up before it's a minor PR disaster for Drupal.

-J

CompShack’s picture

#22
I can't agree more with you slimandslam. As far as i'm concerned, the OpenID in Drupal 6 simply doesn't work.

cburschka’s picture

Version: 6.0 » 6.x-dev
Status: Needs review » Needs work

Completely agreed.

But critical or not, this belongs onto the end of the 6.x branch. +1 for pushing a 6.1 release as soon as possible when it's done, so that the damage is limited.

I'll update my patch to allow OpenID to skip email verification, since after all that defeats the point of OpenID. ;)

cburschka’s picture

Status: Needs work » Needs review

... okay, now I'm confused. It seems that the OpenID module already takes into account the possibility of email verification?

But how can account creation work with OpenID when an email address is required?

In any case, here is what might a better sanitizing function. It will return a combination of the lowest subdomain and lowest path token, which has a better chance of guessing a good name (doesn't solve problems with "www" though).

/**
 * Sanitize the openid or the nickname to comply with our own restrictions on a username.
 *
 * @param $id The OpenID URL to sanitize
 *
 * @return $name A valid username for a Drupal account. 
 */

function _openid_username_from_id($id) {
  $tokens = parse_url($id);
  $name = strrev(substr(strrchr(strrev($tokens['host']), '.'), 1)) .'-'. substr(strrchr($tokens['path'], '/'), 1); 
  $name = trim(preg_replace('/[^a-z0-9]+/', '-', $name), '-');
  return $name;
}
walkah’s picture

Assigned: Unassigned » walkah
Priority: Critical » Normal

OK, let me hop in here and clear up some misunderstandings:

First off : OpenID is an authentication protocol - I suggest everyone read OpenID is *not* an account. OpenID is for providing secure logins across sites. We decided - when committing this to core - that OpenID based accounts should be valid Drupal accounts.

For registration, we've currently implemented the SREG (Simple Registration) protocol to ease registration... if you use an OpenID Provider that supports SREG, your account will be automatically created - I suggest you try myopenid.com to see for yourself.

@slimandslam - I appreciate your concern - and education about *what* exactly openid is is important...

That said, we can look at attempting to either a) clean up the error message text to be more explanatory (although it already went through several reviews) or b) trying to 'best guess' a username - but users will stil be required to enter an email.

Grabbing this issue...

cburschka’s picture

Status: Needs review » Needs work

A combination of both, perhaps. Autofill the username field, but redirect to user/register/openid if no email address was given through SREG. We probably need to implement our own form and validation that builds on the normal user_register validation, but uses different messages.

The most confusing thing currently is that registering with pretty much any OpenID will cause an error. Essentially it says "OpenID failed because you're a noob who forgot to enter an email address which by the way we didn't ask for before, and because your OpenID contains characters that don't match a normal username, which, I don't know, could be because it's a URL.". Note that it's completely possible to register a new OpenID in spite of the errors - you just have to enter a username and email address; the OpenID will get attached to the new account. This is a case of an unintuitive user interface.

Instead it should say something like "You are identifying at this site for the first time and will need to confirm your OpenID account with a valid email address, please enter one here." - and show the OpenID field along with the user name (pre-filled, but changeable), and the email. This way, the user knows that the process is normal, and won't think the site mucked up.

cburschka’s picture

Status: Needs work » Needs review

This patch changes the string for a failed auto-registration to be more explanatory, and also displays the OpenID URL (non-editable) on the form to indicate to the user that this is not a fallback to normal registration, but a normal part of the OpenID registration process.

Also, the default nickname is taken from the last token of the path, or the host name if that doesn't exist.

cburschka’s picture

StatusFileSize
new3.28 KB

This patch changes the string for a failed auto-registration to be more explanatory, and also displays the OpenID URL (non-editable) on the form to indicate to the user that this is not a fallback to normal registration, but a normal part of the OpenID registration process.

Also, the default nickname is taken from the last token of the path, or the host name if that doesn't exist.

cburschka’s picture

StatusFileSize
new3.25 KB

Corrected the phpdoc description of the new function.

slimandslam’s picture

Even the flow using myopenid.com isn't very smooth. If I enter http://fred.myopenid.com instead of fred.myopenid.com, I still get the illegal characters message. This kind of confusion is unnecessary -- Drupal should remove or ignore the "http://" part automatically.

cburschka’s picture

You seem not to have tested my patch yet. Please do so and provide feedback to that, so we can move forward... :)

cburschka’s picture

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

Anyone?

Leaving aside the improved user interface, the current behavior of shoving URLs into the user name is really buggy. I'll move this up to 7.x so it can get more eyes to look at it (will check later if it still applies to HEAD), but this absolutely has to be ported to 6.x and get into 6.1.

dries’s picture

I'd like James Walker (walkah) to approve this -- he is the OpenID maintainer/expert. :)

slimandslam’s picture

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

The patch seems to work ok. I haven't tested it thoroughly, but it's far better than Drupal 6 as is. Is there a way to ensure it makes it into Drupal 6.1?

J

cburschka’s picture

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

Not unless we backport it later, I guess. Standard approach is to fix bugs in the unstable branch first.

I haven't checked compatibility with head; no time right now.

moshe weitzman’s picture

Priority: Normal » Critical
dries’s picture

Would be great if we could extend the PHPdoc a bit more. It's probably useful to quote part of the OpenID spec. This will help developers understand why things are stripped.

vkha’s picture

in my case (drupal 6.x), when I try use OpenID, I am transferred to yahoo.com, loging in and confirming that my drupal site should be accepted for openid authentication and... nothing happens. no error or whatever I just stay not logged :-/

Same with livejournal.com

XiMac’s picture

Why not attach the OpenID to a kind of user? The OpenID users, different from registered, etc ..., and treat this new kind of user as others users, using the openID as username ... this will simplify enormously this problem since the admin could select this new kind of user what can do at what can't do on the options for this specific user (mostly, leave the openID users to comment)

cburschka’s picture

Why not attach the OpenID to a kind of user? The OpenID users, different from registered

Because OpenID is not designed for that. OpenID servers cannot be trusted implicitly (any spammer can set one up), and nor does it tell you anything about persons you haven't had prior contact with.

It works like this:

- If you gave Alice posting privileges on your site, and she in turn told you to trust the OpenID server Trent with her identity, then Trent can tell you "this person who's trying to authenticate as Alice on your site is indeed Alice".
- Trent can also tell you "this person is Bob", but that's useless to you: Someone named Bob may or may not exist on your site, but you have no idea whether he is the same person. Any spammer may have registered on Trent as "Bob". Bob must log in normally, and then tell you that he is indeed the person who Trent is identifying as him. (I've summarized that from my own understanding, please correct me if necessary.)

So Drupal cannot just wave everyone through who has an OpenID; it has to create an account to attach these OpenIDs to.

On the other hand, the password and email address are exactly the kind of thing that the user doesn't want to enter, since the point of OpenID is to provide identity without exposing sensitive information. So when a user wants to create an account while using their OpenID, we want to require as little additional information as possible.

The password we can do without. If somebody is never going to authenticate in any other way than OpenID, they don't need a password.

The email address is different. The question is: "Does Drupal need the email address for other purposes than authentication/lost passwords?" If it doesn't, then it must not be required for OpenID accounts. If it does, then the email address must be entered (and verified) separately.

valthebald’s picture

IMHO silent autoregistration is better solution. I agree that any spammer can register as many openids as he wants, but who cares? Do you mind several additional accounts on your site?
Just opening account doesn't give new user any significat permissions, he should be given specific roles to perform things, so I don't see problem here.
What would I do is create drupal user with preset name (like 'openid_%id') , email nomail@yoursite.tld and link him to openid identity.

cburschka’s picture

StatusFileSize
new5.89 KB

Entering your name once is a trivial inconvenience compared to being locked into a name of "openid_xxx" that you can't change later. Silent account creation is overrated.

The only problem with the way things are done right now is that the user is hit with a multitude of error messages during the normal process, and that's really easy to fix. In February, slimandslam called OpenID in Drupal 6 essentially "broken". We can fix it with little more than changing the color and text of the message.

I've rewritten a smaller patch for Drupal 7. This one no longer tries to autogenerate anything at all: It checks if the username and email are filled by the OpenID server, and asks the user to enter them if they weren't.

lilou’s picture

Status: Needs review » Needs work

Patch need to be re-rolled.

aufumy’s picture

StatusFileSize
new3.9 KB
new3.89 KB

Re-rolling with the warning message containing message about OpenID provider, simple registration support.

OpenID registration failed for the reasons listed. Your OpenID persona did not provide the information requested, such as username and email or your OpenID provider does not support Simple Registration. Please complete the registration process manually, or <a href="@login">log in</a> now and add your OpenID under "My Account"', array('@login' => url('user/login'))), 'warning');
aufumy’s picture

Status: Needs work » Needs review
deviantintegral’s picture

I haven't tested the patch at all, but I would like to say that it's a very good thing I tested this on my site before my users started complaining :)

I think the text of the error feels a little long, and I think would scare first-time OpenID users. Here's a shorter version which I think gets the point accross (shows the error, provides a solution). Also, it's entirely possible that users won't understand that OpenID != account, so this clears that up (in my testing, I thought Drupal was directing me to create a non-linked account).

Your OpenID provider did not provide a valid username or email address. Please complete the OpenID registration process manually by creating a username for !site-name, or providing an email address. Alternately, <a href="@login">log in</a> now and add your OpenID under "My Account".

--Andrew

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

incidentist’s picture

Status: Needs work » Needs review
StatusFileSize
new3.89 KB

Fixes D7 version of #45 so that:

* patch applies properly
* item ['#value'] changed to item ['#markup']
* Claimed ID retrieved properly

jaharmi’s picture

I’m enthusiastic about both OpenID and Drupal, but I agree that the new login process is broken. It tripped me up the one time I’ve tried to log into a new Drupal 6.x site with one of my OpenIDs.

This thread is great, though, and I’m finding out a lot — just the mention of SREG is valuable. (Interestingly, my provider is listed as supporting SREG, but the Drupal login process I refer to above was still very confusing. Perhaps the provider’s support is new since my login attempt.)

I’m also very supportive of all of the work that has already gone into OpenID and Drupal. It sounds like the technology is good and I’m hopeful the process can be improved.

valthebald’s picture

Actually, it's user module that prevents registration of OpenID users, not OpenID module itself.
User module does not allow symbols like @ or . in usernames, in addition OpenID providers I checked (Yahoo and LiveJournal) leave email field in SREG empty.
I was stuck with this problem couple of months ago and decided to generate fake emails and usernames to make user module happy.
Of course, this is done if OpenID authentication went ok.
You can try this module http://drupal.org/project/openid_autoreg

moshe weitzman’s picture

We can change user.module for D7. I think those periods and @ are fine. Can anyone think of a reason to exclude them.

christefano’s picture

The only reason I can think of for excluding @ and . symbols is to automatically disallow email addresses. (Collecting email addresses may violate local laws such as COPPA in the US, but it's easy to get around that by asking for the parents' email address.) It would be nice for this "allow email addresses as usernames?" behavior to be configurable in the admin user settings, similar to what's offered by LoginToboggan.

dries’s picture

Can we write a test for the D7 patch? The OpenID module badly needs some additional tests.

calebgilbert’s picture

I arrived at this issue in order to review it and after reading the whole thread I've concluded that this issue is not at reviewable stage because there is no consensus at all about what the problem/cure is.

Some are talking about auto-creating the user if it the openid server doesn't support SREG, others are saying that we need to refactor user_validate_username, and still others are talking about merely refactoring error messages in the existing system.

I'm tempted to set this back as "Needs work" but am leaving as is.

For what it's worth my personal opinion is that it totally kills the point of using openid, if someone has to fill out anything at all when they hit a Drupal site and/or gets these kind of errors. +1 to autocreating the user (even if that means disabling openid for cases where email verification is required).

c960657’s picture

+    if (isset($_SESSION['openid']['values']['name']) && user_validate_name($_SESSION['openid']['values']['name'])) {
+      $form['name']['#default_value'] = $_SESSION['openid']['values']['name'];
+    }

This should be $form['account']['name']['#default_value'] = ….
user_validate_name() returns FALSE, when the argument is valid. But I suggest you skip the validation here and simply show whatever username was supplied by SREG.

If I try to auto-register using an OpenID provider without SREG support, I am requested to enter a username and an email address. My OpenID is displayed at the bottom of the registration page. When I submit, the user account is created, but my OpenID never appears in the {authmap} table, i.e. I cannot use it to log into my new account.

As long as users cannot change their username, I think it is better to let them choose one at registration if their provider doesn't support SREG rather than to autogenerate one. FWIW, the SREG specification does mention that end user interaction is sometimes required to register an account (see the description of openid.sreg.required and openid.sreg.optional).

BTW Yahoo currently don't support SREG, but the plan to do so (according to this).

valthebald’s picture

Status: Needs review » Needs work

I guess this discussion already passed the borders mentioned in it's title :)
Should it be broad discussion of openid users processing in D7?

valthebald’s picture

+1 for "allow email addresses as usernames?" setting in D7 (#53)

scor’s picture

Status: Needs work » Needs review

latest patch in #45 does not apply properly, rerolling.

added a test for this patch which checks whether the user was asked to complete the registration process manually.

scor’s picture

StatusFileSize
new7.47 KB

attaching patch for comment above

oriol_e9g’s picture

Assigned: walkah » Unassigned

#26 Unassignin issue, 1 year and 4 months without walkah feedback

Status: Needs review » Needs work

The last submitted patch failed testing.

Wesley Tanaka’s picture

If I remember correctly from my work on http://code.google.com/p/google-app-engine-django-openid/ Google's OpenID provider also does not support SReg (though it does support AX).

Livejournal's OpenID provider supports neither.

I recommend that the message which is printed out if no SReg/AX data can be found not contain the word "failed" and not be marked as an error, since it will be pretty common that no SReg/AX data is provided.

Wesley Tanaka’s picture

tags

Wesley Tanaka’s picture

Presumably the message could/should be as short as:

"To complete your OpenID registration process, please enter your email address and desired username here:"

c960657’s picture

The patch fails to address the comments in the first paragraph of #56. Please extend the test to verify that the email and username fields are in fact prefilled with the expected values (they currently are not).

+    $this->assertRaw('<script type="text/javascript">document.getElementById("openid-redirect-form").submit();</script>', t('JavaScript form submission found.'));

I suggest you use the pattern used in testLogin() instead, i.e. assert that the title is "OpenID redirect". This point was addressed here, but it was only fixed in one of three places - assumeably due to an oversight.

+  if (variable_get('openid_non_sreg')) {
+    $nickname = 'http://scor.net/myopneid';
+    $email = '';
+  }

Please use an example.com URL. If you simply want to test an invalid username, I suggest you use something that does not look like a URL.

Instead of introducing a boolean variable, openid_non_sreg, I suggest you adopt the more general approach suggested in #364348: OpenID throws an error when two accounts try to use the same OpenID,
+ $response = variable_get('openid_test_response', array()) + array(, i.e. remove the two openid.sreg.* lines from openid_test.module and add them to testRegisterUserWithoutEmailVerification() instead.

Anonymous’s picture

Module from #51 saved my day. E.g. an openID from myopenid.com looks like "username.myopenid.com". But the "." in the name, are not allowed by the user module from Drupal. That's why many openID names don't work. Nothing wrong with the openID module, just not well integrated with Drupal 6.

So I tried the http://drupal.org/project/openid_autoreg module, and that solved it.

But of course, this should be out-of-the-box Drupal-core handling...

c960657’s picture

Status: Needs work » Needs review
StatusFileSize
new12.48 KB

New patch based on the one in #61 that address the comments in #67.

Status: Needs review » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Needs review

Test bot glitch?

mcrittenden’s picture

Subscribe.

mv1’s picture

Anyone still working on this?

c960657’s picture

Anyone still working on this?

There is a patch ready for review. Feel free to try it out and report your findings. When the problem is fixed in HEAD (i.e. what will become Drupal 7), it may be back-ported to Drupal 6.

samchok’s picture

subscribing

Status: Needs review » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Needs review
StatusFileSize
new12.83 KB

Reroll.

heine’s picture

Status: Needs review » Needs work

OpenID registration failed for the reasons listed, possibly because your OpenID provider did not provide a valid username and e-mail-address. You may register manually, or if you already have an account you can log in now and add your OpenID under "My Account".

- What reasons?
- The sentence in bold is confusing. What does "register manually" mean?

aufumy’s picture

Just throwing out another attempt at this text

OpenID registration did not complete. Please manually complete the process; register a new account (if needed) and <a href="@login">log in</a> to link your OpenID to the account.

The reason that the process was not successful, was that your OpenID provider did not provide the required information; e.g. username and email or that your OpenID provider does not support Simple Registration.
aufumy’s picture

This issue has touched on many parts.

1) When sreg is not supported/working properly by the OpenID provider, there is no clear message to the user, which is confusing, and w/o message points to Drupal's OpenID module as being broken.

2) Should the user module support openid urls or email addresses.

3) Should a randomized username/email be automatically created if none are provided or should the user be prompted to enter a username/email if none are provided.

I think this issue should focus in on part 1)

part 2) I believe has been discarded maybe for the reasons mentioned by christefano. If the user wants this behavior maybe they can be pointed to a module that allows usernames to contain @ and .

part 3) This could be a configurable setting, maybe another issue should be opened for this part.

aufumy’s picture

Status: Needs work » Needs review
c960657’s picture

StatusFileSize
new16.7 KB

With this patch, a different message is displayed depending on whether the provider supplied no SREG information at all (that is, neither username nor email), or it provided invalid/incomplete information (e.g. a duplicate username or an invalid email).

aufumy’s picture

StatusFileSize
new65.73 KB
new48.87 KB
new68.12 KB
new67.17 KB

The patch works for me! +1

When attempting to use gmail as openid, non patched screenshot

After patch applied

When attempting to login with myopenid, where there exists a user account with the same email address, non patched screenshot

After patch applied

hotelfoo’s picture

Wesley Tanaka’s picture

I think that the sentence "Your OpenID provider did not provide a username or e-mail-address." could be removed in the first no-error case. If I were a simple user of OpenID who didn't know about how OpenID worked, I would find that first sentence confusing. Part of OpenID's marketing is that you don't need separate accounts on each different site on the net. When Drupal is asking you to make an account anyway, I think the onus is on Drupal to explain why it is forcing you as the user to do this extra work of registering instead of phrasing it as if it were a problem with the OpenID provider.

However, that said, this patch already looks like a huge improvement on the existing behavior, and I certainly wouldn't want to be making the perfect the enemy of the good.

c960657’s picture

StatusFileSize
new16.57 KB

I agree.

mcrittenden’s picture

#86 looks good to me. Anybody else care to RTBC?

Status: Needs review » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Needs review
StatusFileSize
new16.56 KB

Reroll.

mcrittenden’s picture

Status: Needs review » Reviewed & tested by the community

I'll do the honors then.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new16.56 KB

Simple reroll due to a Doxygen comment change.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new16.69 KB
dries’s picture

Doesn't this create a huge hole for spammers? All they need to do is set-up their own OpenID provider and they the Drupal doors open ...

c960657’s picture

I'm not sure what kind of spamming you are referring to. The auto-registration is just an automated way of filling out the username and email fields on the account creation page.

dries’s picture

Ah, I incorrectly assumed that it by-passed the e-mail confirmation step.

By the way, "My Account" should be "My account". Needs a quick re-roll.

c960657’s picture

StatusFileSize
new16.69 KB

Reroll with just the requested change.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new16.69 KB

Sorry, forgot to update the tests.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Needs review

Test bot failure?

c960657’s picture

Status: Needs review » Reviewed & tested by the community

Apparently so.

The error was “Failed: Invalid PHP syntax in modules/openid/tests/openid_test.module”. I have seen a few of those false alarms lately. This time it was slave #44 FWIW.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Needs review

A small update due to #118345: Revamp hook_user_form/_register/_validate/_submit/_insert/_update.

mcrittenden, would you care to give this a quick re-review?

c960657’s picture

StatusFileSize
new16.76 KB

Sorry, forgot the patch.

Status: Needs review » Needs work

The last submitted patch failed testing.

vacilando’s picture

Subscribing.

mikl’s picture

Subscribing.

mcrittenden’s picture

@c960657 sorry, just saw that. If you get a chance to re-roll, I'll be glad to review.

c960657’s picture

Status: Needs review » Needs work
StatusFileSize
new16.77 KB

Reroll.

c960657’s picture

Status: Needs work » Needs review
mcrittenden’s picture

you can <a href="@login">log in</a> now

Could use a title on all those <a>'s. Other than that, it looks RTBC to me.

c960657’s picture

AFAICT we don't usually add titles to this kind of links. Which title would you suggest?

mcrittenden’s picture

Status: Needs work » Reviewed & tested by the community

Oh really? I was just thinking like a title="Log In" or something like that. But in that case, RTBC.

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

I read through this issue's comments and the expanded tests (thanks to aufumy in #83 for the nice summary). It looks like all of peoples' various feedback has been incorporated, and while walkah has yet to chime in, I trust c960657's opinions, since he wrote our most excellent suite of OpenID tests.

Committed to HEAD. I'm marking to be ported to 6.x. Hopefully the fix can be the same there, although it does change the registration workflow slightly which could invalidate existing documentation. Then again, any existing documentation documenting this particular branch of logic would've had to say something like "Ignore the 50,000 errors you get when you do this" so maybe this is not so bad after all. ;)

c960657’s picture

FYI: I have made a proposal in #637850: Show confirmation page during OpenID auto-registration that makes some of the new warning messages redundant. I still think a backport of this issue is relevant, though.

jmlane’s picture

Subscribing, as I am interested in seeing this backported to 6.x.

Great work, c960657!

c960657’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new4.66 KB

Backported to D6.

BWT, if you want to help improve OpenID support in D6, there is a small backported patch waiting for review in #222044: Openid login failed with Blogger users.

dgtlmoon’s picture

worked for me

mcrittenden’s picture

Status: Needs review » Reviewed & tested by the community

Same here.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed to Drupal 6, thank you!

gábor hojtsy’s picture

BTW it would be great if you could help out with this small PHP 4 compatibility issue in openid.module :) See the end of the issue only. Thank you: #575796: OpenID XRI test violates the spec..

web2’s picture

Hi,

After applying patches (#119) to openid module I face this error -
Error in query: SELECT name FROM {role} WHERE rid IN ().
Please help.

web2’s picture

Status: Fixed » Active

Openid core module is not working. I upgrade Drupal to 6.15 and expected fix for #216101 long time bug as committed here http://drupal.org/node/661600.

heine’s picture

Status: Active » Fixed

@web2, please open a new issue with steps to reproduce your problem. "not working" is not really helpful :)

vacilando’s picture

Same problem as @web2 under D6.14. Spent ages trying to find out why. Finally problem removed after upgrading to Drupal 6.15 (since the patch got overwritten by the openid module shipped with that version). Not clear whether this patch is included in D6.15 or not.

Status: Fixed » Closed (fixed)

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

bryancasler’s picture

subscribe

mcrittenden’s picture

Remove tags since this is fixed.