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

console - email address change workflow #4208

Merged
merged 6 commits into from
Mar 29, 2024
Merged

Conversation

emmdurin
Copy link
Contributor

@emmdurin emmdurin commented Mar 14, 2024

Added a workflow to change user e-mail address.

Still missing things :

  • check e-mail address format before sending validation e-mail
  • e-mail conflict checking
  • e-mail template to fine tune
  • use a separate column in token DB to store e-mail address instead of reusing UID column
  • translations

Dear {name},

You asked to change your e-mail address on {publicUrl}/.
If you did not request any password update, just ignore this e-mail, you're safe (I DON'T THINK SO).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e-mail update ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are reacting about the "I DON'T THINK SO", I had a doubt when I wrote it about a possible security problem, but now I think I misunderstood the workflow and there is no longer a problem if a user receive such an e-mail without having asked for it. It just means that someone else entered his e-mail in change form, but without validating it won't do anything more.

@landryb
Copy link
Member

landryb commented Mar 14, 2024

does this make sure that the new e-mail isn't already in use by another existing user ? iirc an email can/should be linked with only one account..

@emmdurin
Copy link
Contributor Author

emmdurin commented Mar 14, 2024

does this make sure that the new e-mail isn't already in use by another existing user ? iirc an email can/should be linked with only one account..

If it is already in use, it will silently fail with an exception when the user loads validation link, and user will be redirected to user details page as if it worked, except his e-mail won't have changed.

We may check for conflicts before, but what to do next ? If we inform the user that new e-mail already exists, doesn't this have a security concern so that he could know if a specific e-mail from anyone is registered on the platform ? I ask this because I see that in password recovery procedure, we do not allow users to know if the e-mail entered is registered. We could also proceed to next step silently but without sending the e-mail to not bother the real recipient.

@landryb
Copy link
Member

landryb commented Mar 14, 2024

If we inform the user that new e-mail already exists, doesn't this have a security concern so that he could know if a specific e-mail from anyone is registered on the platform ?

that's already the case in the account creation form, if you try to register with an email that is already linked with an existing account you get rejected/pointed at the password reset form

image

so yes, maybe you can see that as a security concern/user list harvesting, but if you look at it from the pov of the end-user or an user admin that has confused users on the phone, making sure that it is clearly reported to the user that this new e-mail can't be used (before sending anything to anyone) is important.

@emmdurin
Copy link
Contributor Author

so yes, maybe you can see that as a security concern/user list harvesting, but if you look at it from the pov of the end-user or an user admin that has confused users on the phone, making sure that it is clearly reported to the user that this new e-mail can't be used (before sending anything to anyone) is important.

OK, so we should go this way and report it to the user

@fvanderbiest fvanderbiest changed the title E-mail address change console - email address change workflow Mar 15, 2024
@fvanderbiest fvanderbiest added this to the 24.0.0 milestone Mar 15, 2024
@emmdurin emmdurin force-pushed the email_address_change branch 2 times, most recently from a545947 to c371a61 Compare March 28, 2024 09:12
@emmdurin emmdurin force-pushed the email_address_change branch from c371a61 to 6bec135 Compare March 28, 2024 09:15
@emmdurin emmdurin marked this pull request as ready for review March 28, 2024 09:15
@emmdurin emmdurin requested review from landryb and f-necas March 28, 2024 09:15
@landryb
Copy link
Member

landryb commented Mar 28, 2024

i welcome the feature but i don't think i qualify to review this java/jsp madness ;)

@landryb landryb removed their request for review March 28, 2024 14:20
@f-necas
Copy link
Contributor

f-necas commented Mar 28, 2024

I pushed a commit to :

  • Format UserTokenDao file
  • Update email template and some translations
  • Move a console admin log to a normal dev log
  • Add a log translations for console admin page

image
logs.emailchangeemailsent is no longer needed as it won't be logged here

Copy link
Contributor

@f-necas f-necas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :) Thanks for this nice feature !

As discussed we can improve IT tests on it but I hope we could find time to re-develop the console without jsp and angularJS behind it.

We can also use hibernate in future to get rid on those queries in every file.

I also have to fix this geonetwork CI ...

@emmdurin emmdurin force-pushed the email_address_change branch from a5d70b1 to 7692806 Compare March 29, 2024 11:04
@emmdurin emmdurin force-pushed the email_address_change branch from 63eb1bf to 4020f81 Compare March 29, 2024 11:26
@emmdurin emmdurin merged commit 966ed85 into master Mar 29, 2024
3 of 6 checks passed
@emmdurin emmdurin deleted the email_address_change branch March 29, 2024 12:03
@emmdurin emmdurin restored the email_address_change branch March 29, 2024 12:23
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 this pull request may close these issues.

4 participants