-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Security][Notifier] Added integration of Login Link with the Notifier component #38552
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
[Security][Notifier] Added integration of Login Link with the Notifier component #38552
Conversation
src/Symfony/Component/Security/Http/LoginLink/LoginLinkNotification.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bridge/Twig/Resources/views/Email/zurb_2/notification/body.html.twig
Outdated
Show resolved
Hide resolved
weaverryan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!
Maybe some tests also? 😇
src/Symfony/Bridge/Twig/Resources/views/Email/zurb_2/notification/body.html.twig
Outdated
Show resolved
Hide resolved
| $durationString = floor($hours).' hour'.($hours >= 2 ? 's' : ''); | ||
| } | ||
|
|
||
| return sprintf('Click on the '.$target.' to confirm you want to sign in. This link will expire in %s.', $durationString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just this?
Click on the $target to sign in. This link..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This text is based on the Auth0 passwordless authentication email: https://auth0.com/docs/connections/passwordless/guides/email-magic-link
I thought adding "confirm you were the person actually requesting to login" might be a good security feature to add to the mail. Do you have any suggestions on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, good for me then 👍
I thought adding "confirm you were the person actually requesting to login"
What do you mean? It might be a good idea (like they do in the Auth0 email) to say something like:
If you did not request this, you can simply ignore this email.
Auth 0 says "Hit reply to contact us"... but (like with a reset password email), there is nobody preventing a "login link" from being emailed to you... so receiving an email doesn't seem like a "problem".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's not a big problem. But getting such email without you requesting it indicates something is a bit wrong. And given email are quite badly protected, it might indicate that someone has now logged in as you.
I like the idea of adding the "If you did not request this, you can simply ignore this email.".
8ce2b91 to
e4b42d2
Compare
|
Thanks for the reviews! PR updated (apart from the 2 comments I replied on)
Both classes in this PR are rather basic data objects. I've added some tests on the |
weaverryan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be ready! It would be great to have another set of eyes on any wording, but I would love to have this for the login link system @fabpot
src/Symfony/Component/Security/Http/LoginLink/LoginLinkNotification.php
Outdated
Show resolved
Hide resolved
e4b42d2 to
8bb7bac
Compare
8bb7bac to
04ef565
Compare
|
Thank you @wouterj. |
This adds a
LoginLinkNotificationthat uses theNotificationEmailand integrates with the notifier component. This makes it much easier to use the login link functionality, as it provides a default email and sms implementation.The
NotificationEmailis slightly changed, to allow bypassing the logging-related functionality. Also, @weaverryan suggested to remove the "created by Symfony" footer as this email is meant to be sent to all users of a service.