xmpp-prebind-php
xmpp-prebind-php copied to clipboard
Authentication is not working properly with the new version of Openfire
The auth() method is not working properly the success reponse doest not satisfy. In the Openfire 3.10 version the sucess response is a little different.
if (!$body->hasChildNodes() || $body->firstChild->nodeName !== 'success') {
throw new Exception("Invalid login");
}
i am facing the same issue are , are you able to resolve it ?
@ntimesc I have not my dev env anymore, but if I remember the success has not child anymore so this file https://github.com/candy-chat/xmpp-prebind-php/blob/master/lib/XmppPrebind.php#L218 should be something like
if ($body->firstChild->nodeName !== 'success') {
throw new XmppPrebindException("Invalid login");
}
My suggestion could be:
~$ diff lib/XmppPrebind.php xmpp-prebind-php/lib/XmppPrebind.php
219,220c218
< // if (!$body->hasChildNodes() || $body->firstChild->nodeName !== 'success') {
< if (!isset($body->firstChild->nodeName) || $body->firstChild->nodeName !== 'success') { // $body->firstChild->nodeName might not exists !
---
> if (!$body->hasChildNodes() || $body->firstChild->nodeName !== 'success') {
$body might not be an object at all, it's better to check it. Even more: encryption doesn't work at all with OF ! I might be more specific or if you prefer I can open a new issue for it (or a pull request if you want it)
yes can you post a new issue please