Common xmpp errors 1 and common xmpp errors

Source: Internet
Author: User

Common xmpp errors 1 and common xmpp errors

# Pragma mark-Incorrect password, authentication failed-(void) xmppStream :( XMPPStream *) sender didNotAuthenticate :( DDXMLElement *) error {NSLog (@ "authentication failed % @", error);} // <failure xmlns = "urn: ietf: params: xml: ns: xmpp-sasl "> <not-authorized> </failure>

Cause: the username configuration is incorrect.

NSString * userName = @ "tqhTest"; NSString * hostName = @ "127.0.0.1"; // 3. set JID and host of XMPPStream // [_ xmppStream setMyJID: [using jidWithString: userName]; // @ 127.0.0.1 [_ xmppStream setMyJID: [XMPPJID jidWithUser: userName domain: @ "127.0.0.1" resource: nil]; [_ xmppStream setHostName: hostName];

In fact, questions about XMPP authentication are generally related to JID. To solve this problem, the first choice is to analyze the JID of XMPPStream. After the client is connected to the server, socket is bound to this port to process round-trip data with the server. authentication is one of them. in addition, we often use localhost or 127.0.0.1 as the domain name for the sake of simplicity when we connect to the server. In this case, pay special attention to the following, when using Spark or other client programs to log on, using such a domain name to log on to the server is no problem, but you must be very careful when dealing with the code. You must be at the back of the server, confirm domain name unification:

Enter your own domain

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.