At the first login, if the Idp doesn't pass an email address attribute to the module, the user receive the warning:

"Email is missing.error in simplesamlphp_auth.module: no valid mail attribute set"

1) there is a error in message traslation logic (line 332):

$message = t('Email is missing.' . $e->getMessage());

The exception message, usually very technical, should be hidden to the final user; I suggest to replace with:

drupal_set_message(t('Email is missing.'), "error");
watchdog('simplesamlphp', t('Email is missing.') . $e->getMessage(), WATCHDOG_CRITICAL);

2) More important: this warning is useful only if the user has some control over the attributes passed (e.g. the Idp uses the Consent module).
Otherwise (e.g. the Idp could not found the mail attribute in the backend authsource) the warning is only an annoyance, because the user cannot resolve the problem by himself.
If the mail address is not critical for the site services, I suggest that the warning can be switch off by module administration.

Comments

colan’s picture

Version: 6.x-2.7 » 7.x-2.x-dev
Category: feature » bug
Status: Active » Fixed

Thanks. I think I got it in 2f9a1e5.

As far as disabling the warning goes, isn't that field required from the IDP? If so, we should leave it in. If I'm wrong here, please reopen.

colan’s picture

Title: Switching off missing email address warning » Broken logging for missing e-mail addresses & usernames

This was also a problem for usernames. Fixed in 0c76785.

I fixed the poorly orchestrated watchdog() call for both; an argument was missing.

Status: Fixed » Closed (fixed)

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