xmpp-prebind-php icon indicating copy to clipboard operation
xmpp-prebind-php copied to clipboard

Authentication is not working properly with the new version of Openfire

Open theoziran opened this issue 10 years ago • 4 comments

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");
}

theoziran avatar Apr 30 '15 13:04 theoziran

i am facing the same issue are , are you able to resolve it ?

ntimesc avatar Oct 18 '15 09:10 ntimesc

@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");
}

theoziran avatar Oct 18 '15 11:10 theoziran

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)

andreabenini avatar Nov 19 '15 11:11 andreabenini

yes can you post a new issue please

ntimesc avatar Nov 20 '15 18:11 ntimesc