This repository was archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
This repository was archived by the owner on Nov 21, 2024. It is now read-only.
In the official document, I haven't see reply with an additional challenge response. #27
Copy link
Copy link
Open
Description
At XmppPrebind class 450 line:
$challengeResponse = $this->send($domDocument->saveXML());
return $this->replyToChallengeResponse($challengeResponse);which meaning to reply xmpp server when SASL authenticate success. but at official document i haven't see this step. if i do this. I will got a XmppPrebindException said: Invalid login!!
Here is request and response error xml content (xmpp server is Openfire):
#### request:
<?xml version="1.0" encoding="UTF-8"?>
<body xmlns="http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="4723813009" xml:lang="en" sid="603v7hlcaw">
<response xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
</body>
### response:
<body xmlns='http://jabber.org/protocol/httpbind' ack='4723813009'><failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure></body>
So in my code, I has remove this unnecessary step:
/**
* Send challenge request and build DIGEST-MD5 auth string
*
* @param Auth_SASL_Common $auth
* @return string Auth XML to send
*/
protected function sendChallengeAndBuildDigestMd5Auth(Auth_SASL_Common $auth) {
$challenge = $this->sendChallenge();
$authString = $auth->getResponse(self::getNodeFromJid($this->jid), $this->password, $challenge, $this->jabberHost, self::SERVICE_NAME);
$this->debug($authString, 'DIGEST-MD5 Auth String');
$authString = base64_encode($authString);
$domDocument = $this->buildBody();
$body = self::getBodyFromDomDocument($domDocument);
$response = $domDocument->createElement('response');
$response->appendChild(self::getNewTextAttribute($domDocument, 'xmlns', self::XMLNS_SASL));
$response->appendChild($domDocument->createTextNode($authString));
$body->appendChild($response);
// $challengeResponse = $this->send($domDocument->saveXML());
//
// return $this->replyToChallengeResponse($challengeResponse);
return $domDocument->saveXML();
}Then login, restart, and bind resource is successfully.
- The function
sendChallengeAndBuildCramMd5Authtoo.
Is this reply step not needed?
I had fork your project to: https://github.com/lzqwebsoft/xmpp-prebind-php, remove this step and remove FirePHP (because firebug out), last add translate README to chinese. :)
Metadata
Metadata
Assignees
Labels
No labels