Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shibboleth users who predate Shibboleth are assumed to be email-verified but aren't #5663

Closed
donsizemore opened this issue Mar 18, 2019 · 8 comments · Fixed by #8579
Closed
Milestone

Comments

@donsizemore
Copy link
Contributor

This issue is related to #1401 and possibly supersedes #3300. Per Phil and Pete in IRC Shibboleth users are now assumed to have their e-mail addresses verified as trusted / provided by the IdP. For new users this happens. Existing users such as myself and our archivists remain unverified. I can sign in with my Shibboleth account to our test server running 4.11 and don't get an "emailconfirmed" timestamp:

dvntest=> select emailconfirmed from authenticateduser where email='dls@email.unc.edu';
 emailconfirmed 
----------------

(1 row)

I could start wedging in timestamps for institutional users but would love to find the logic snag.

@pameyer
Copy link
Contributor

pameyer commented Mar 18, 2019

I think the logic snag is that when the authenticateduser.emailconfirmed column was added in 4.5.1, it wasn't accompanied by an update setting that column to account creation time for shibboleth users.

@donsizemore
Copy link
Contributor Author

donsizemore commented Mar 18, 2019

@pameyer seems better to make current Shib logins check for emailconfirmed and set if necessary — we have a bunch of users matching unc.edu who may or may not sign in going forward. My inner Security Chicken Little would prefer to leave them NULL.

@pameyer
Copy link
Contributor

pameyer commented Mar 19, 2019

@donsizemore That seems reasonable to me; but means it would take code changes rather than database cleanup.

@pdurbin
Copy link
Member

pdurbin commented Apr 6, 2022

I'm pretty sure I'm affected by this personally in Harvard Dataverse (I had an old account in the DVN 3.x days and I'm using Shib to log in) and the user experience is pretty terrible. Here are some screenshots from 5.10:

I noticed "Not Verified" and clicked "Verify Email".

Screen Shot 2022-04-06 at 11 44 22 AM

I get a "success, email sent" message

Screen Shot 2022-04-06 at 11 44 41 AM

The email I received is nonsensical (no link, for example, no content, really)

Screen Shot 2022-04-06 at 11 45 39 AM

Knowing what I know from hacking on pull request #8579 recently, I'm aware that the user experience is even further confusing because prior to that pull request if you go back to Account Information and click "Verify Email" a pop up will show (screenshots below). What this popup is TRYING to say is that an email has already been sent. In the that pull request we decided to remove the popup. Here's how it looks in 5.10:

I'm back on "Account Information" (within 24 hours so the link/token is still present in the database)

Screen Shot 2022-04-06 at 11 51 06 AM

Confusing popup that's trying to say an email has already been sent

Screen Shot 2022-04-06 at 11 51 14 AM

Given all this, what's the plan? Some thoughts:

  • We want Shib users to always see "Verified". They should never see a "Send Verification Email" button. They should never have the user experience above.
  • From a quick look at the code, emailLastConfirmed (a timestamp) is only set for Shib users on account creation. Perhaps this should be set every time the Shib user logs in. That way, both new users and returning users would be treated the same. (Hopefully installations aren't relying on emailLastConfirmed not changing.) As users log in, emailLastConfirmed will be populated for the ones who didn't have it. That means they won't see the "Send Verification Email" button.

Update: Examples of the mostly empty nonsensical email above:

@donsizemore
Copy link
Contributor Author

@pdurbin I love the idea of populating emailLastConfirmed on each login just as Shibboleth attributes would update stored database fields. Q: how/will this affect OAuth users? (thinking OIDC)

@pdurbin
Copy link
Member

pdurbin commented Apr 6, 2022

@donsizemore great. Update at each login. Sounds like a plan.

OAuth and OIDC users would not be affected by any change I'm planning for this issue. For OIDC, please note that there's an open issue about email verification:

Meanwhile I did some more Shib testing locally and wanted to share some screenshots and a bug I'd like to fix.

When you create a Shib account, the process is fine (email shows as verified) except that the in-app notification says, "check for your welcome email to verify your address." This part of the message shouldn't be shown to Shib users. The email itself is fine. That is, the email correctly does not include a link or any text about verifying your email.

Screen Shot 2022-04-06 at 12 24 27 PM
Screen Shot 2022-04-06 at 12 27 41 PM
Screen Shot 2022-04-06 at 12 27 55 PM


Subject: Root: Your account has been created

Hello,
Welcome to Root! Get started by adding or finding data. Have questions? Check out the User Guide at https://guides.dataverse.org/en/5.10/user or contact Root Support Team at support@mailinator.com for assistance.

You may contact us for support at support@mailinator.com.

Thank you,
Root Support Team


I have the change queued up locally to update the in-app notification for newly created Shib users.

@pdurbin
Copy link
Member

pdurbin commented Apr 6, 2022

More screenshots. I also looked at converting accounts from builtin to Shib. The bug here is that the email is not automatically set to verified.

Screen Shot 2022-04-06 at 2 09 30 PM
Screen Shot 2022-04-06 at 2 10 08 PM

Another potential bug is that a "confirm email" token is in the database for this user. Presumably this token was created back when I created the builtin user. Perhaps the conversion process to Shib should clear out any "confirm email" tokens. In practice, this is not a big problem because this token will simply expire in 24 hours (by default).

pdurbin added a commit that referenced this issue Apr 7, 2022
…okens #5663

For Shib users we now set the emailconfirmed timestamp on login.
(The guides say we do this already but are wrong. It was only
being set on account creation.)

For Shib users, I also prevent "check for your welcome email to
verify your address" from being shown in the in-app
welcome/new account notification.

I put in a check to make sure Shib users never get a "verify your
email address" email notification.

Finally, I removed the hasNoStaleVerificationTokens check from the
hasVerifiedEmail method. We've never worried about if there are
stale verification tokens in the database or not and this check
was preventing "Verified" from being shown, even when the user has
a timestamp (the timestamp being the way we know if an email is
verified or not).
pdurbin added a commit that referenced this issue Apr 8, 2022
…okens #5663

For Shib users we now set the emailconfirmed timestamp on login.
(The guides say we do this already but are wrong. It was only
being set on account creation.)

For Shib users, I also prevent "check for your welcome email to
verify your address" from being shown in the in-app
welcome/new account notification.

I put in a check to make sure Shib users never get a "verify your
email address" email notification.

Finally, I removed the hasNoStaleVerificationTokens check from the
hasVerifiedEmail method. We've never worried about if there are
stale verification tokens in the database or not and this check
was preventing "Verified" from being shown, even when the user has
a timestamp (the timestamp being the way we know if an email is
verified or not).
@pdurbin
Copy link
Member

pdurbin commented Apr 8, 2022

I put fixes in this pull request:

@pdurbin pdurbin removed their assignment Apr 8, 2022
@pdurbin pdurbin added this to the 5.11 milestone May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants