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

Anonymous login? #19

Closed
poVoq opened this issue Feb 13, 2021 · 15 comments
Closed

Anonymous login? #19

poVoq opened this issue Feb 13, 2021 · 15 comments
Assignees
Labels
enhancement New feature or request

Comments

@poVoq
Copy link

poVoq commented Feb 13, 2021

Is it possible to configure this to allow a very simple public webinterface for some MUCs that will just ask for a nick and handle temporary accounts through the XMPP server's anonymous login mechanism?

A bit like what happens here with the conversejs instance linked: https://logs.xmpp.org/operators/

Also, can MUCs be deep-linked via a URL? So that several different MUCs could be made available through it via URLs from a website? Edit: or alternatively configure a list of MUCs to auto-join?

Thanks for the help!

@nioc
Copy link
Owner

nioc commented Feb 13, 2021

Hello @poVoq allowing anyone to join public anonymous MUC without login previously seems to be a little difficult in the actual model (since login is required to access other GUI components).
I'm not against a dedicated component if someone propose a pull request 😃

For the second part, it is already possible to access a MUC, let's say you have a room named conference.domain.ltd, you can access it directly by passing in the URL the following path /rooms/{room-jid}, for example: https://chat.domain-web.ltd/rooms/welcome@conference.domain.ltd

@nioc nioc added enhancement New feature or request help wanted Extra attention is needed labels Feb 13, 2021
@poVoq
Copy link
Author

poVoq commented Feb 13, 2021

It is actually a login mode supported by XMPP servers. It creates a temporary account in the background, see for example: https://prosody.im/doc/anonymous_logins (but ejabberd can also do it). But maybe I misunderstood the concern?

@nioc
Copy link
Owner

nioc commented Feb 14, 2021

I'm not sure to fully understand the call-flow explained in prosody doc, but here is what I think:

  • If anonymous authentication is allowed on XMPP server, user may log without login, nickname, password (jid is provided by server).
  • Call-flow is a bit tricky (see the 9 steps described here).
  • I'm not sure that (or how) StanzaJS library handle it (I searched a bit but I did not see how to call this flow).
  • Last but not least : current VueJS app logic requires user login before accessing other GUI components, it implies to edit authentication component and all the logic upon it to allow anonymous access and restrict access to non allowed function for these users.

At this time, this enhancement seems to be a long time work...

@poVoq
Copy link
Author

poVoq commented Feb 14, 2021

Hmm, that is a pity because a lightweight web-chat with minimal onboarding barriers might be a really cool use-case for this.

I did find a test for StanzaJS that seems to do login via an anonymous method, might be something else though:
https://github.com/legastero/stanza/blob/d44cda0e79877c49ff26810c6cb35742b1624c33/test/sasl/anonymous.ts

@nioc
Copy link
Owner

nioc commented Feb 14, 2021

Yes, i saw and also mentioned in code here.
But how to use it... I've not found in library doc.

App code use theses 2 functions XMPP.createClient and client.connect:

      this.client = XMPP.createClient({
        jid,
        password,
        resource: resource || 'Web XMPP',
        transports: transports || { websocket: true, bosh: true },
      })

      this.client.connect()

Let me know if you found how to handle it and I'll see how to adapt app to handle anonymous access.

@Neustradamus
Copy link

To follow this ticket.

@nioc
Copy link
Owner

nioc commented Feb 14, 2021

Sunday evening update:

I found how to connect to anonymously using Stanza, it was simple but not documented 😞, just add server attribute and remove jid and password:

      this.client = XMPP.createClient({
        server: 'anon.localhost',
        resource: resource || 'Web XMPP',
        transports: transports || { websocket: true, bosh: true },
      })

      this.client.connect()

I'll look how to update existing logic (services/XmppSocket.js) to reusing it.

Next step will be designing a new "Guest" vue component, here it is a first proposal:

  • user access to guest page (with dedicated url, that should contains a room),
  • then user auto connect to XMPP server as anonymous guest,
  • app request public rooms,
  • app display public rooms as list if room was not provided in url or not found in public room list,
  • app load room if found in list.

@nioc nioc self-assigned this Feb 14, 2021
@nioc nioc removed the help wanted Extra attention is needed label Feb 14, 2021
@poVoq
Copy link
Author

poVoq commented Feb 14, 2021

Thanks a lot for working on this!

Maybe some simplified view that disables some features that make little sense for anonymous users could also be configurable? Things like "contacts" and the top left account part.

@nioc
Copy link
Owner

nioc commented Feb 14, 2021

Yep, only chat view will be displayed after joining room.
I think this is a interesting feature but I do not want to break the entire application design 😆

@Neustradamus
Copy link

@nioc: Thanks, maybe you can see to add more informations in Stanza documentation :)

@nioc nioc closed this as completed in 036a674 Feb 15, 2021
@Neustradamus
Copy link

@nioc: Good job, thanks!
Have you planned to see for Stanza doc?

One guy can test it?

@nioc
Copy link
Owner

nioc commented Feb 15, 2021

Hi, work done.
Here is a 0.6.0 release beta including guest access.
You obviously need an anonymous host on your Prosody and to complete it in local.js as anonymousHost attribute.

Let me know if you encounter any issues with it before I publish the release.

@nioc
Copy link
Owner

nioc commented Feb 15, 2021

@Neustradamus Stanza provide XML abstraction (and it is a huge work) for this app but I do not contribute on it. As author has closed issues, I suppose he is not widely open to contributions... and I do not have time to update third party library documentation 😉

@nioc
Copy link
Owner

nioc commented Feb 15, 2021

Some screenshots in reduced screen size (screenshot is the full app).

Nickname:
XMPP web-guest-1

Rooms list:
XMPP web-guest-2

Chat:
XMPP web-guest-3

And I forget to say about url:

  • guest access: /guest
  • guest access with requested room: /guest?join=debug@conference.localhost
  • then when guest joined room: /guest/debug@conference.localhost

@Neustradamus
Copy link

@nioc: Please talk with @legastero here.
But yes, he has removed "Issues" section from repository because I have done several issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants