Support email 3pid #188

Open
opened 2021-11-09 01:47:44 +00:00 by jblachly · 6 comments
jblachly commented 2021-11-09 01:47:44 +00:00 (Migrated from gitlab.com)

Problem

Editing user preferences to add or associate an email address with an existing account results in an error.

In elements web app for instance, when adding an email, one is met with error request failed: CORS request rejected: https://server.url/_matrix/client/r0/account/3pid/email/requestToken. Examination of network traffic reveals 404 rather than CORS error per se.

Reason

The endpoint /_matrix/client/r0/account/3pid/email/requestToken [0] does not exist.

Proposal

Support email 3pid throughout the homeserver and identity server; ultimately, we MUST support addition and removal of email to the user account, and we SHOULD support validation of email [0], and using email to recover account / reset password. [1]

Proposed solution

  1. Modify the User struct and database table to include an email field.
  2. Modify endpoint third_party_route in src/client_server/account.rs to return the email 3pid
  3. Add endpoint /_matrix/client/r0/account/3pid/email/requestToken at end of src/client_server/account.rs
  4. (Future) Add email validation workflow; will require one or more email provider backends/APIs. I would defer this work for now and initially just add the email to the account directly to enhance UX.

As a side note, the work could be trivially duplicated (minus step 3, validation) to also support adding phone number/msisdn 3pid type.

References

[0] https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-account-3pid-email-requesttoken

[1] https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-account-password-email-requesttoken

# Problem Editing user preferences to add or associate an email address with an existing account results in an error. In elements web app for instance, when adding an email, one is met with error `request failed: CORS request rejected: https://server.url/_matrix/client/r0/account/3pid/email/requestToken`. Examination of network traffic reveals 404 rather than CORS error _per se_. # Reason The endpoint `/_matrix/client/r0/account/3pid/email/requestToken` [0] does not exist. # Proposal Support email 3pid throughout the homeserver and identity server; ultimately, we MUST support addition and removal of email to the user account, and we SHOULD support validation of email [0], and using email to recover account / reset password. [1] # Proposed solution 1. Modify the `User` struct and database table to include an email field. 2. Modify endpoint `third_party_route` in `src/client_server/account.rs` to return the email 3pid 3. Add endpoint `/_matrix/client/r0/account/3pid/email/requestToken` at end of `src/client_server/account.rs` 4. (Future) Add email validation workflow; will require one or more email provider backends/APIs. I would defer this work for now and initially just add the email to the account directly to enhance UX. As a side note, the work could be trivially duplicated (minus step 3, validation) to also support adding phone number/msisdn 3pid type. # References [0] https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-account-3pid-email-requesttoken [1] https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-account-password-email-requesttoken
jblachly commented 2021-11-09 02:36:00 +00:00 (Migrated from gitlab.com)
Implementation notes ### Token management Spec: https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-account-3pid-email-requesttoken RUMA: https://github.com/ruma/ruma/blob/main/crates/ruma-client-api/src/r0/account/request_3pid_management_token_via_email.rs ### Add 3pid (presumably called via the emailed token callback) Spec: https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-account-3pid-add RUMA: https://github.com/ruma/ruma/blob/main/crates/ruma-client-api/src/r0/account/add_3pid.rs
jblachly commented 2021-11-09 02:37:40 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
timokoesters commented 2021-12-14 14:16:34 +00:00 (Migrated from gitlab.com)

This has low priority for now because you can easily use matrix without email.

This has low priority for now because you can easily use matrix without email.
chris-morgan commented 2022-02-12 05:13:50 +00:00 (Migrated from gitlab.com)

mentioned in issue #237

mentioned in issue #237
jblachly commented 2022-07-15 23:11:59 +00:00 (Migrated from gitlab.com)

mentioned in merge request !375

mentioned in merge request !375
zicklag commented 2024-02-02 01:24:55 +00:00 (Migrated from gitlab.com)

I'm unsure if this issue is exactly what's needed, but I've just started up a conduit server as a light-weight replacement for my Rocket.chat server, and the only thing I'm missing so far is the ability to send email notifications for mentions.

Is this issue what's necessary to support email notifications, and would you be open to PRs for it? I probably won't get the time, but just in case, I might be able to work on it.

I'm unsure if this issue is exactly what's needed, but I've just started up a conduit server as a light-weight replacement for my Rocket.chat server, and the only thing I'm missing so far is the ability to send email notifications for mentions. Is this issue what's necessary to support email notifications, and would you be open to PRs for it? I probably won't get the time, but just in case, I might be able to work on it.
Sign in to join this conversation.
No labels
Android
CS::needs customer feedback
CS::needs follow up
CS::needs on prem installation
CS::waiting
Chrome
Design:: Ready
Design:: in progress
Design::UX
E2EE
Edge
Firefox
GDPR
Iteration 13 IM
Linux
MacOS
Need::Discussion
Need::Steps to reproduce
Need::Upstream fix
Needs:: Planning
Needs::Dev-Team
Needs::More information
Needs::Priority
Needs::Product
Needs::Refinement
Needs::Severity
Priority::1-Critical
Priority::2-Max
Priority::3-Impending
Priority::4-High
Priority::5-Medium
Priority::6-Low
Priority::7-None
Progress::Backlog
Progress::Review
Progress::Started
Progress::Testing
Progress::Triage
Progress::Waiting
Reporter::Sentry
Safari
Target::Community
Target::Customer
Target::Internal
Target::PoC
Target::Security
Team:Customer-Success
Team:Design
Team:Infrastructure
Team:Instant-Messaging
Team:Product
Team:Workflows
Type::Bug
Type::Design
Type::Documentation
Type::Feature
Type::Improvement
Type::Support
Type::Tests
Windows
blocked
blocked-by-spec
cla-signed
conduit
contribution::advanced
contribution::easy
contribution::help needed
from::review
iOS
p::ti-tenant
performance
product::triage
proposal
refactor
release-blocker
s: dart_openapi_codegen
s::Famedly-Patient
s::Org-Directory
s::Passport-Generator
s::Requeuest
s:CRM
s:Famedly-App
s:Famedly-Web
s:Fhiroxide
s:Fhiroxide-cli
s:Fhiroxide-client
s:Fhirs
s:Hedwig
s:LISA
s:Matrix-Dart-SDK
s:Role-Manager
s:Synapse
s:User-Directory
s:WFS-Matrix
s:Workflow Engine
s:dtls
s:famedly-error
s:fcm-shared-isolate
s:matrix-api-lite
s:multiple-tab-detector
s:native-imaging
severity::1
severity::2
severity::3
severity::4
technical-debt
voip
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Matthias/conduit#188
No description provided.