I wrote a proof of concept that allows the user to sign up to a service using their matrix ID e.g @user:server.test. The user then receives an activation link in an encrypted room from the service. It worked quite easily and within 2 days of fumbling around with the matrix SDK in python and FastAPI, here we are.

This has been in my head for a while and I just wanted to see if it’s possible (the proof is in the pudding code). Emails are insecure and national services are starting to implement communication services on top of matrix. It’s a not inconceivable that citizens might get a government issued Matrix account and communicate safely with the government over a secure protocol. Why not allow other services to do the same?

Imagine if instead of providing your email address for signing up to services you used matrix instead. Your host wouldn’t be able to read your messages and it could replace things like 2FA codes over SMS, activation links in emails, or health documents from your doctor’s CMS in your email inbox.

Should there be enough time, I’d like to try and contribute this login method to forgejo (the software behind codeberg that’s hosting this repository), but let’s see. First it would take learning go 😅

  • Jade@programming.dev
    link
    fedilink
    arrow-up
    12
    ·
    2 months ago

    Hi there, Continuwuity developer here - This seems like an awesome idea! You might also want to see if you can use/extend the new oauth specification from MAS to create a more ‘Log in with Social’ like experience, too, although only Synapse supports that right now

    • TheOfficial@programming.devOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 months ago

      Hey @JadedBlueEyes@programming.dev, are you talking about Synapse’s SSO implementation? I’ve had to deal with SAML before and it wasn’t a particularly joyful experience but since synapse makes it possible, it would indeed be a useful contribution to Forgejo too! Maybe it’s just a question of providing documentation and some example configs for Forgejo to make instance owners aware of the Synapse SSO capabilities.

      The reason I went with this is implementation is because email just seems to be a notification and communication channel used by other services. Giving the additional option of using Matrix could be easier for devs than figuring out SAML or OIDC.

      Question about continuwuity: how can I create an admin user? It might be missing from the doc and the docker image doesn’t have a register_new_matrix_user script.

    • TheOfficial@programming.devOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 months ago

      Thanks :)

      Email is just the communication channel. The relevant code for sending the activation code is just a few lines. Though, there is of course more work to be done for full integration:

      • validation of the matrix ID in the frontend (probably a regex?)
      • storing encryption keys and room IDs for conversations in order to continue sending messages in to the same encrypted room with users
      • adding a mechanism to select either email or matrix for users and allowing secondary matrix IDs (should the user want that)

      It should be possible to have this in more projects, but it would probably take a big player to recognise a value (encrypted communication with their users) and adopt it.

  • XenGi@feddit.org
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 months ago

    Matrix was sure a nice idea but still doesn’t work remotely as food as it needs to, to replace email for that. I take an unencrypted insecure email over matrix any day.

    • TheOfficial@programming.devOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      2 months ago

      simplelogin provides email aliases? Using a matrix ID doesn’t solve spam issues. The service could be hacked and all matrix IDs leaked and it would be the same as your email address being leaked.
      So, an equivalent service or feature would have to be created for matrix that allows users to generate aliases for use with different services.

      rambling of other (non) solution

      Ooor, users could sign up with room IDs! That would actually solve the problem. As user could create a private room, copy the ID into the signup form, and the service would send messages into the room. It could save the list of participants in the room, i.e your matrix ID though 🤔 So not really a solution.

      Good question! Thank you for asking. This would indeed require a solution and aliases built into a matrix server would be the best option. Maybe… uh… @JadedBlueEyes@programming.dev as a matrix server developer could think of something?

      • Jade@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        For spam protection, we use tools like meowlnir or draupnir with the cooperation of the homeserver to allow completely blocking spam invites - so if a matrix ID goes evil you can leave the room you have with them and add them to a ban list, and you can subscribe to a variety of other ban lists to ban things in advance