XMPP Common Error One

Source: Internet
Author: User

#pragma mark-wrong 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></not-authorized> </failure>       

Cause: Incorrect user name configuration

 nsstring *username = @ "tqhtest "; NSString *hostname = @ "127.0.0.1 "; //3. Xmppstream and host Settings Jid // [_xmppstream Setmyjid:[xmppjid jidwithstring: UserName]]; //@127.0.0.1 [_xmppstream Setmyjid:[xmppjid Jidwithuser:username domain:@ "127.0.0.1 " Resource:nil]"; [_xmppstream Sethostname:hostname];             

In fact, the XMPP authentication problem, is generally related to Jid, so solve this kind of problem, the first choice is to analyze the Xmppstream Jid, the client after connecting with the server, the socket is bound to the port, to handle the round-trip data with the server, Certification is one of them. And, often we are connected to the server, in order to be simple, often use localhost or 127.0.0.1来 as part of the domain name, this time to pay particular attention, because when using spark or other client program login, use such domain name login service Server is not a problem, but in the code to deal with special care, be sure to in the back of the servers, confirm the domain name unification:

Fill in your domain

XMPP Common Error One

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.