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

Force Anonymous login on React Native? #770

Closed
Doko-Demo-Doa opened this issue Aug 29, 2019 · 2 comments
Closed

Force Anonymous login on React Native? #770

Doko-Demo-Doa opened this issue Aug 29, 2019 · 2 comments

Comments

@Doko-Demo-Doa
Copy link

This might be related to #593 , I'm not sure, but when I use the lib on React Native, with username/password or not, the authentication method is always PLAIN:

Tracing down to @xmpp/sasl/index.js I saw this:

image

But features only contains 4 mechanisms:

  • PLAIN
  • SCRAM-SHA-1
  • CRAM-MD5
  • DIGEST-MD5

And no ANONYMOUS

I need anonymous authentication for account registration first, then login using registered account. From above info, I created a client:

    this.xmpp = client({
      service: 'ws://testdomain:7071/ws',
      domain: 'testdomain',
      credentials: function authenticate (auth, mechanism) {
        console.log('authenticate', mechanism)
        const cred = null
        return auth(cred)
      }
    })

and as expected, mechanism is always PLAIN

Is there a way to fix this?

@sonnyp
Copy link
Member

sonnyp commented Aug 30, 2019

The issue seems to be that your server does not offer anonymous authentication on that domain.

You probably should use https://xmpp.org/extensions/xep-0077.html directly instead. Unfortunally xmpp.js does not have helpers for it but it should be quite easy to implement yourself and if you'd like to contribute the code to xmpp.js I'd be happy to help.

I could be wrong but I'm not aware of registration from an anonymous session being a thing in XMPP anyway.

@sonnyp sonnyp closed this as completed Sep 15, 2019
@sonnyp
Copy link
Member

sonnyp commented Oct 4, 2019

see #783

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants