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

Allow to log in as a guest #719

Open
probonopd opened this issue Dec 28, 2020 · 6 comments
Open

Allow to log in as a guest #719

probonopd opened this issue Dec 28, 2020 · 6 comments
Labels
enhancement A feature or change request for Quaternion

Comments

@probonopd
Copy link
Contributor

probonopd commented Dec 28, 2020

Description

We would like to preinstall Quaternion in our helloSystem operating system as a means for our users to access a pre-configured channel. It should be possible to join as a guest, without a need to sign up.

Ideally, everything could be preconfigured (via command line parameters) so that from an end user point of view they would never be asked for anything, just dropped directly into the channel.

Steps to reproduce

Missing here:

  • A way to log in as a guest user
  • A way to preconfigure a channel
  • A way to (optionally) skip this screen altogether

image

Version information

Quaternion-0.0.9.4_7.txz on FreeBSD

@probonopd
Copy link
Contributor Author

Possibly related to #560

@KitsuneRal
Copy link
Member

KitsuneRal commented Dec 29, 2020

I don't want to sound negative but I really wonder if Quaternion is a good choice for "mere mortals", let alone a natural transition from macOS. I intended it to be a reference client for libQuotient, with technical bits and pieces sticking out pretty much everywhere.
That being said, with respect to your points:

  • I wouldn't recommend using guest users, the way they are defined in Matrix. Guest logins in Matrix are very limited, and public rooms by default only allow guests (any user, actually) a view access but disallow joining (which usually gains message sending rights, in particular) as a guest user. Moreover, the way they are specced now, guest accounts are not recognised across federation; there's no way for another server to determine whether a particular user is a guest. What this means is that guests can be sent invites from another server but be forbidden to join a room if it turns out to not allow guests. Note also that in Synapse (the most-used homeserver implementation), guest user ids are a series of random digits - all but human-friendly.
  • Guest user login should be implemented in libQuotient first (Guest login libQuotient#433); alternatively, you might consider registering a proper user and issuing an access token without involving Quaternion (merely by issuing a curl request). Beware that this can be a spam vector.
  • Pre-inviting to a room is generally preferred in Matrix, rather than pre-joining a room. Taking into account the above on guest accounts, with full-fledged user accounts you can auto-invite a user from the server-side - any compliant client including Quaternion will display this invitation as the only entry in the room list.

@probonopd
Copy link
Contributor Author

probonopd commented Dec 29, 2020

Thanks for your detailed response @KitsuneRal.

What would you do if you wanted users to allow joining an IRC-type channel without having to register and without the need to pick a password?

In the "old times" I would have preinstalled an IRC client on the desktop that would join #helloSystem on irc.freenode.net automatically, and be done with it. But this has the downside that people tend to come in, ask a question, and then go offline again before anyone could answer the question.

I was thinking that Matrix would allow such users to come back the next day, and see the history.

How would one do this "properly" using Matrix?

@KitsuneRal
Copy link
Member

It's all doable in Matrix, with a caveat around creating a user account (guest or not). Sorry for another long read below.

  • If it's a guest account, you can make it at any homeserver that allows guest registrations (matrix.org won't do, though - it disabled guest accounts sometime ago), not necessarily the one you manage; but that account doesn't have a lot of freedom. If you make the support room yourself, you can create it on that same homeserver you use to generate guest accounts and configure the room to allow guest joining; so people will be able to come, ask a question, and later come back for the answer in pretty much the way you expect it to work, as long as they use the same device. That user account will be of limited use outside of this case though - for one, as mentioned above, users will quickly find they are unable to join many public rooms with it. If you don't care about that, guest accounts might still be your option.
  • If it's a full-fledged user account, you'll need a cooperating (or your own) homeserver that will allow you to create users in an automatic way. The good thing is that users will be able to use this new account anywhere Matrix federation goes. Going without a password can be arranged in a number of ways; Matrix allows single sign-on flows for authentication, e.g. (e.g., the Mozilla homeserver uses that); or if you want to go entirely passwordless, you can register the user with some random sequence for the password, receive the access token, and store it in your system user account in such a way that your default client would pick it up (Quaternion, in particular, uses libsecret; you can put the access token to the keychain with certain parameters, and Quaternion will use it). Users won't be able to recover that account if the access token is lost or invalidated (logging out invalidates the access token); and the homeserver these accounts were registered at will have to deal with quite a bit of account garbage therefore.

Once the user account is made/obtained (you might want to ask the user if they already have a Matrix account, and login to it instead, e.g.), the best (most polite) way forward is to send that user's id to a bot running on the homeserver that would invite that user to the support room. That means you'll have to run the bot that would listen for connections from pretty much anywhere in the Internet. The more invasive way that doesn't require a bot would be to use the received access token to authorise a network request (via curl or anything) that would auto-join that user to the support room. One client I know (Tensor, unmaintained now) had auto-joining people to its room literally hardcoded - most people didn't care but some complained (especially those with pre-existing accounts); so maybe ask the user before auto-joining in case they gave you a pre-existing account.

HTH.

@probonopd
Copy link
Contributor Author

probonopd commented Dec 29, 2020

Thanks @KitsuneRal.

Still, a "guest" button on that login screen would be worthwhile to have imho.

@KitsuneRal
Copy link
Member

Right, once quotient-im/libQuotient#433 is done, I'll add a "guest" button to Quaternion too.

@KitsuneRal KitsuneRal added the enhancement A feature or change request for Quaternion label Mar 12, 2021
@KitsuneRal KitsuneRal moved this to 0.2 - To Do in Quaternion 1 Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or change request for Quaternion
Projects
Status: 0.2 - To Do
Development

No branches or pull requests

2 participants