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

Base64 authentication calculation doesn't work with Cisco IM&P #85

Open
npetreley opened this issue May 17, 2017 · 4 comments
Open

Base64 authentication calculation doesn't work with Cisco IM&P #85

npetreley opened this issue May 17, 2017 · 4 comments

Comments

@npetreley
Copy link

npetreley commented May 17, 2017

In xmpp_stream.php

This doesn't work:

$stanza->t(base64_encode("\x00".$user."\x00".$pass));

This does work:

$usernamepos = strpos($user,"@");
$username = substr($user,0,$usernamepos);
$stanza->t(base64_encode($user."\x00".$username."\x00".$pass));

CIMP is expecting an encoded combination of jid, username, and password. I cobbled my solution together. I didn't bother to look to see if I could access the username directly, so I just substringed it.

@npetreley
Copy link
Author

npetreley commented May 18, 2017

After some googling, I see many code examples with the encoding I used (jid, username, password) for other Jabber servers, too, not just CIMP. Is it possible that the way JAXL is handling it is simply wrong? At least wrong for PLAIN?

@npetreley
Copy link
Author

npetreley commented May 18, 2017

I just noticed the same solution is presented in the BOSH problem thread. The solution there is more elegant:

$stanza->t(base64_encode($user."\x00".substr($user,0,strpos($user,'@'))."\x00".$pass));

@abhinavsingh
Copy link
Member

abhinavsingh commented May 18, 2017 via email

@npetreley
Copy link
Author

Can you point me to the XMPP RFC on that? I can't find it.

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

No branches or pull requests

3 participants